Open inkeliz opened 4 years ago
I think supporting concurrency in systems would be an amazing thing! There are a few issues that would need to be worked through, mostly that openGL calls MUST be done on the main thread, the operating system requires it. So the render system or any system that does drawing would have to be guaranteed somehow to run on the main thread.
Golang is a language that have a good support for concurrency and multithreading. I'm testing some stuff, as always, but I'm hit at
fatal error: concurrent map read and map write
.Seems that Engo isn't capable to support multi-thread by default. There's a lot of map without any mutex:
https://github.com/EngoEngine/engo/blob/d2790d2de842bc8298ace6abb7a1136ee0a9aba5/common/render.go#L277-L281 https://github.com/EngoEngine/engo/blob/d2790d2de842bc8298ace6abb7a1136ee0a9aba5/common/spritesheet.go#L113-L127
That error can be triggered with anything like:
...
I'm thinking about create a queued channel, intended to receive and then calls Engo.
There's any plan to support concurrency?