Comments (5)
LiquidWorld
is not Sync, so you should not share it between threads at all. Only one thread may own and interact with the LiquidWorld
. Using unsafe
to bypass this behavior is, well, unsafe.
from salva.
Sharing between threads is done using the Send
trait, not Sync
. It's not Send
either though.
from salva.
Sharing between threads is done using the
Send
trait, notSync
. It's notSend
either though.
Actually, sharing between threads is done by Send
ing a shared reference:
A type is Sync if it is safe to share between threads (T is Sync if and only if &T is Send).
If LiquidWorld
was Send
, you would be able to transfer it between threads, but not use it from multiple threads simultaneously.
from salva.
True, not at the same time, but you could wrap it in an Arc<Mutex<LiquidWorld>>
and use it sequentially from multiple threads.
from salva.
True, not at the same time, but you could wrap it in an
Arc<Mutex<LiquidWorld>>
and use it sequentially from multiple threads.
That's true, because Arc
is Send
and Mutex
is Sync
, emulating the exact same behavior mentioned above.
from salva.
Related Issues (16)
- [Advice] Add MPM
- world-aware adding of particles to fluid system HOT 10
- build salva3d with sampling feature breaks HOT 1
- Incorrect Poly6 gradient HOT 3
- Feature request: Adhesive properties
- Update to latest rapier/nalgebra versions HOT 3
- deleting particles panics when IISPH solver used
- deleting particles over time
- panic when removing boundary HOT 1
- bug in salva3d::sampling::shape_surface_ray_sample() with a heightfield
- SPF +all mechanism should not be used at salva.rs
- Changelog is missing
- Documentation talks about nphysics, but this package interfaces with rapier instead
- Fit new Rapier?
- Example package version issue HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from salva.