casperes1996
Site Champ
- Posts
- 251
- Reaction score
- 292
Never used OpenMP, but in theory you could spin up your own background thread that deals with OpenMP and have a simple run loop in the main thread that just goes "Are there new things from the OpenMP multi-threading thread that I should respond to? No? I'll loop back around then" or something - At least I would imagine it'd be possible to make that sort of thing work, but of course this still comes at complexity costsThe other thing about OpenMP that is a little odd these days is the model of making synchronous code parallel, constrained by the design that the code should behave fundamentally the same if OpenMP is disabled at compile time (just on a single thread). The end result is that you will block the calling thread (i.e. main) when using OpenMP which is a bad situation to be in on Apple platforms. Say hello to the pinwheel of death.
Regarding LibDispatch (GCD) on Windows - How does Swift Concurrency work on Windows?