Asynchronous tasks
#20
(04-15-2015, 09:24 PM)NiLSPACE Wrote: Wouldn't it be slow to copy all the values over and over?
It depends what you're sending. I wouldn't recommend sending big Lua data structures over but for small things its fine.


(04-15-2015, 09:24 PM)NiLSPACE Wrote: What is the big advantage if we give each thread it's own LuaState?

It simplifies a lot of the multithreading issues. LuaStates are currently not thread safe but rely on each plugin only being called by one thread at a time. This makes having a worker thread for a plugin within the same state useless because you can't use it for long work due to blocking the plugin lock.
If we give the thread its own LuaState it means that we can use a separate lock for the thread rather than having to make LuaState thread safe.

Also it deals with issues like race conditions in plugin code. With the message passing API it is much harder the write race conditions into simple code.
Reply
Thanks given by: NiLSPACE


Messages In This Thread
Asynchronous tasks - by Howaner - 03-11-2015, 05:58 AM
RE: Asynchronous tasks - by NiLSPACE - 03-11-2015, 06:12 AM
RE: Asynchronous tasks - by worktycho - 03-11-2015, 06:16 AM
RE: Asynchronous tasks - by NiLSPACE - 04-12-2015, 12:39 AM
RE: Asynchronous tasks - by xoft - 04-12-2015, 01:31 AM
RE: Asynchronous tasks - by NiLSPACE - 04-12-2015, 09:54 PM
RE: Asynchronous tasks - by xoft - 04-13-2015, 12:50 AM
RE: Asynchronous tasks - by xoft - 04-13-2015, 12:54 AM
RE: Asynchronous tasks - by NiLSPACE - 04-13-2015, 01:29 AM
RE: Asynchronous tasks - by worktycho - 04-15-2015, 09:49 AM
RE: Asynchronous tasks - by NiLSPACE - 04-15-2015, 05:46 PM
RE: Asynchronous tasks - by worktycho - 04-15-2015, 07:45 PM
RE: Asynchronous tasks - by xoft - 04-15-2015, 08:06 PM
RE: Asynchronous tasks - by worktycho - 04-15-2015, 08:24 PM
RE: Asynchronous tasks - by NiLSPACE - 04-15-2015, 08:26 PM
RE: Asynchronous tasks - by worktycho - 04-15-2015, 08:34 PM
RE: Asynchronous tasks - by NiLSPACE - 04-15-2015, 09:13 PM
RE: Asynchronous tasks - by worktycho - 04-15-2015, 09:16 PM
RE: Asynchronous tasks - by NiLSPACE - 04-15-2015, 09:24 PM
RE: Asynchronous tasks - by worktycho - 04-15-2015, 09:36 PM
RE: Asynchronous tasks - by xoft - 04-15-2015, 09:48 PM
RE: Asynchronous tasks - by worktycho - 04-15-2015, 09:59 PM
RE: Asynchronous tasks - by NiLSPACE - 09-28-2015, 08:10 PM
RE: Asynchronous tasks - by xoft - 09-28-2015, 09:53 PM
RE: Asynchronous tasks - by NiLSPACE - 09-28-2015, 10:00 PM
RE: Asynchronous tasks - by worktycho - 09-28-2015, 10:09 PM



Users browsing this thread: 11 Guest(s)