Hey!
#4
Hello and welcome.

You have come in the right time, I was just thinking about posting some Lua-related questions in the Lua world, fishing for answers; perhaps you can help me out then. That is, if I understood right and you are a developer familiar with Lua Smile

We're having quite a lot of trouble in regards with Lua + threading. Our current model is "one lua state per plugin", and since the server uses multiple threads, it uses a mutex to lock the access to the entire plugin, to prevent parallel access to the lua state. However, most of the lua API calls can be blocking - for example querying a block needs to lock the world, and moving a player between worlds needs to lock two worlds. This has caused quite a lot of deadlocks, and is currently a performance bottleneck for plugins - we cannot use any blocking operations such as network I/O, if the plugin is called periodically by the world's tick thread, because it would block the (timing-critical) thread for considerable amounts of time.

So what does the Lua world have to offer thread-wise to solve this?

I was thinking about making plugins capable of using multiple lua states, so that one such lua state can take care of the world tick thread, and another lua state can take care of the webadmin stuff, and another can do some big calculations, etc. Unfortunately that would mean that the plugin wouldn't be able to share information between those states, there's effectively zero means of communication between them.
Reply
Thanks given by:


Messages In This Thread
Hey! - by qaisjp - 06-11-2014, 07:50 AM
RE: Hey! - by worktycho - 06-11-2014, 08:35 AM
RE: Hey! - by FakeTruth - 06-11-2014, 02:00 PM
RE: Hey! - by xoft - 06-11-2014, 05:45 PM
RE: Hey! - by qaisjp - 06-12-2014, 05:29 AM
RE: Hey! - by xoft - 06-12-2014, 06:31 AM
RE: Hey! - by qaisjp - 06-13-2014, 12:53 AM
RE: Hey! - by FakeTruth - 06-12-2014, 08:17 PM
RE: Hey! - by bearbin - 06-13-2014, 01:00 AM
RE: Hey! - by FakeTruth - 06-13-2014, 01:28 AM
RE: Hey! - by bearbin - 06-13-2014, 01:48 AM
RE: Hey! - by worktycho - 06-13-2014, 01:56 AM
RE: Hey! - by qaisjp - 06-13-2014, 03:03 AM
RE: Hey! - by worktycho - 06-13-2014, 03:29 AM
RE: Hey! - by qaisjp - 06-13-2014, 04:32 AM
RE: Hey! - by worktycho - 06-13-2014, 04:41 AM
RE: Hey! - by qaisjp - 06-13-2014, 04:49 AM
RE: Hey! - by worktycho - 06-13-2014, 05:07 AM
RE: Hey! - by qaisjp - 06-13-2014, 06:07 AM



Users browsing this thread: 10 Guest(s)