Help with LuaHandle callins from unsynchronized thread

Help with LuaHandle callins from unsynchronized thread

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
bilhamil
Posts: 16
Joined: 12 Apr 2011, 10:00

Help with LuaHandle callins from unsynchronized thread

Post by bilhamil »

Hi All,
I've been doing some work recently trying to implement some multitouch features into spring, in a little side project for one of my classes. Anway, I'm trying to implement a Lua callin for touches. Touch events are created in a separate thread than other events (I think) then mouse events etc. I'm getting some race condition problems (I think).

I'm probably going about this in the completely wrong way, but I was wondering if anyone had some insight on how susceptible the code in LuaHandle is to multithread access problems. And if it is, where would be the best place to process touch events would be to prevent these kinds of issues.

Btw I love your engine and I think there are a lot of really cool things that can be done with it!

Thanks!
bilhamil
Posts: 16
Joined: 12 Apr 2011, 10:00

Re: Help with LuaHandle callins from unsynchronized thread

Post by bilhamil »

Hmmmm
From what I can glean it looks like, maybe I need to run my events through SDL using custom events maybe? It seems like that might help with dispatching events cleanly, anyone have experience with this kind of thing?

Thanks!
bilhamil
Posts: 16
Joined: 12 Apr 2011, 10:00

Re: Help with LuaHandle callins from unsynchronized thread

Post by bilhamil »

Just answering my own question, in case anyone else finds themselves wondering.

Using a a SDL_UserEvent I was able to get my events into the SDL system which synched them with all the other events. Seems to have everything cleared up and running smoothly.
Post Reply

Return to “Engine”