Concurrency model

Curious how Mojo is getting around the assumed presence of a GIL. What's the concurrency story?
5 Replies
Ryulord
Ryulord12mo ago
Mojo doesn't have a GIL so you don't need any weird tricks for concurrency
Alex Gunnarson
Alex GunnarsonOP12mo ago
Perfect, thank you! For compilation of / interop with existing Python libraries though, the assumption will presumably be that for stateful classes and functions, some sort of mutex or other concurrency construct will be needed, right?
sora
sora12mo ago
For interop, Mojo calls CPython, so things may effectively run with a GIL. If the code is ported to Mojo, then some sort of concurrency construct is going to be needed. In summary, existing libraries won't magically become thread safe
ModularBot
ModularBot12mo ago
Congrats @sora, you just advanced to level 12!
Alex Gunnarson
Alex GunnarsonOP12mo ago
Makes sense - thanks!

Did you find this page helpful?