Jump to content
The simFlight Network Forums

Starting Lua scripts in separate threads


Recommended Posts

Hi Pete,

I have a couple of Lua scripts that use blocking socket calls. To prevent them waiting for eachother I would like to start them in a seperate thread. This works if I assign a different key to them and start them by pressing all the assigned keys but I would like to do this automatically from ipcready.lua or some other means.

I could rewrite my scripts to use non-blocking socket calls but that would make my scripts (and the other side) much more complicated so if you can suggest a way to start scripts in their own thread I would be very grateful.

Thanks!

Emile van Gerwen

(using registered FSUIPC4, P3D)

Link to comment
Share on other sites

42 minutes ago, Djeez said:

I have a couple of Lua scripts that use blocking socket calls. To prevent them waiting for eachother I would like to start them in a seperate thread. This works if I assign a different key to them and start them by pressing all the assigned keys but I would like to do this automatically from ipcready.lua or some other means.

Lua plug-ins started by another plug-in, like ipcReady do run in separate threads, just like starting them by assignment.

All plug-ins always have their own thread.

Pete

 

 

 

Link to comment
Share on other sites

37 minutes ago, Pete Dowson said:

Lua plug-ins started by another plug-in, like ipcReady do run in separate threads, just like starting them by assignment.

All plug-ins always have their own thread.

Thanks Pete. I always used "require" or "ipc.macro" to start other plug-ins and I overlooked the ipc.runlua command. I guess that is what you refer to. Indeed this solves my problem.

Regards,

-Emile.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.