• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Eluna and multithreading

Status
Not open for further replies.

lukaasm

Enthusiast
Didn't anyone try to bring proper multithreading support for Eluna ? Cause now on high load servers Eluna by now is rather unusable.

Doing it should be fairly easy:

- implement proper threadpool with fixed threads spawned on core start that will handle map / world update requests
- for each thread create own lua state
- push data on lua stack created for thread that request came from


I will probably do it for own core i near future and share code.

What I am asking, are your thoughts on such approach ? Since my experience with Lua is rather low :]
 

Foereaper

Founder
You have to take into consideration that lua in and of itself does not natively support multithreading. While it is definitely possible to improve the stability and efficiency of the engine as a whole, you would have to use third party libraries for the multithreading support specifically. By all means, if you have fixes, rewrites or other additions or changes, feel free to do a pull request and we'll always consider merging it :) all help is good help!

An example of these libraries is lua lanes
 

Rochet2

Moderator / Eluna Dev
I would love some contribution : )
The way arcemu handles this on luabridge is making new lua states for each map only.
Otherwise it works just the same.
For quite some time I have been wondering about what to do, so I just added a thread lock thus far : |
Not exactly top notch dev here :3
 

lukaasm

Enthusiast
doing luapool or per map state seems also nice, since what we really need is only state with own stack. Communication between states seems useless for us for now.

I need to give some thoughts on that matter :]
 
Status
Not open for further replies.
Top