View Full Version : Eluna and multithreading

02-25-2014, 01:05 PM
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 :]

02-25-2014, 03:27 PM
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

02-25-2014, 06:04 PM
Regardless of Eluna, the worldserver still takes up quite a bit of cpu.

02-26-2014, 12:36 AM
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

02-26-2014, 09:59 AM
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 :]