sin
New Member
Posts: 4
|
Post by sin on Nov 6, 2017 13:59:58 GMT
It would be nice if PRO 2 supports fork process for multi tasking. For example, we can run a state machine in such forked script. Parent would be observing and child would be taking orders from parent via pipe. This way the script won't be missing anything while they're making activities because the observer and "actor" in such structure are independent process.
|
|
|
Post by AnkuLua on Nov 6, 2017 16:24:52 GMT
|
|
sin
New Member
Posts: 4
|
Post by sin on Nov 6, 2017 17:26:25 GMT
Very well, thank you.
After a close look this is not what I needed. It's simply swinging between threads and not able to run two threads simultaneously. The parent in this function is always waiting for child (or it's co-routine) to return a value before it continue executing. What I wanted is more like something parent can call and forget. An asynchronous call. In the example in OP the parent and child are both executing all the time and both gain access to a specific chunk of memory(which is pipe in C language) for data passing. Parent observes, throw the pattern or whatever it finds on screen into that memory, keeps observing and doesn't care how child respond. Meanwhile, child is waiting and taking anything dropped into that memory, process whatever it gets and care no what parent is doing.
|
|
|
Post by iamjag on Nov 17, 2017 12:26:12 GMT
As far as I know, LUA does not support real multi-threading. The coroutine is the closest thing. Correct me if I'm wrong, but I spent more than a month looking for multi-threading support for LUA.
I too, will be happy to know if there is a real multi-threading in LUA(async calls). However, my simi-multi-threaded app(coroutine implementation in AnkuLua) is functioning perfectly. The application was able to act on certain game condition such as energy availability, quest(daily or special) availability, daily routine task, guild management, friends management, etc. I'm quite not doing anything except for AB, XAB, Timeline Battle, ShadowLand, and World Boss(You will know the game if your are playing it). I'm working on automating this also.
But my purpose for the app is not to automate the game. I'm using it to gather information and statistics. It helps me decide the build of my characters.
Ooops! Said too much.
So... There it is. No real multi-threading in Lua.
PS: Real multi-threading will greatly improve the efficiency, performance and speed of my script. So please prove me wrong.
|
|