lua task and pthreads

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

lua task and pthreads

Wesley Smith
If there's a more appropriate place to ask this, please let me know.
I've been using lua task to perform some work in a non-blocking manner
and at the same time I have some C++ code that I've made bindings for
that under the hood uses pthreads to load images from disk.  When I
use their lua task or my own threaded loader, I have no problems, but
as soon as I use both in one script, I get all kinds of memory
corruption, bad access etc. errors.  Does anyone know if there's
anything in lua task preventing the use of pthreads in other areas of
a program tat might cause this?  I'm at a loss as to how to debug this
problem because the section that cashes is not where the problem is.
I think memory is getting stomped on somewhere but haven't been able
to pin point it.

thanks,
wes
Reply | Threaded
Open this post in threaded view
|

Re: lua task and pthreads

Jeff Pohlmeyer
On Mon, Jul 13, 2009, Wesley Smith wrote:

> the section that crashes is not where the problem is. I think
> memory is getting stomped on somewhere but haven't been able
> to pin point it.

If you happen to be running on Linux, valgrind[1] sometimes helps
to track down those kind of problems:

  valgrind --tool=memcheck <your-app>

 - Jeff


[1] http://valgrind.org/
Reply | Threaded
Open this post in threaded view
|

Re: lua task and pthreads

Daniel Quintela
In reply to this post by Wesley Smith
Wesley Smith escribió:

> If there's a more appropriate place to ask this, please let me know.
> I've been using lua task to perform some work in a non-blocking manner
> and at the same time I have some C++ code that I've made bindings for
> that under the hood uses pthreads to load images from disk.  When I
> use their lua task or my own threaded loader, I have no problems, but
> as soon as I use both in one script, I get all kinds of memory
> corruption, bad access etc. errors.  Does anyone know if there's
> anything in lua task preventing the use of pthreads in other areas of
> a program tat might cause this?  I'm at a loss as to how to debug this
> problem because the section that cashes is not where the problem is.
> I think memory is getting stomped on somewhere but haven't been able
> to pin point it.
>
> thanks,
> wes
>  
Hi,

LuaTask must not prevent any other use of pthreads.

¿Are you using any thread local storage in your own library?.

¿Are your own threads launched from the main task or from subtasks?.


I hope those questions can trigger some idea... ;-)


Regards,
Daniel

Reply | Threaded
Open this post in threaded view
|

Re: lua task and pthreads

Wesley Smith
Just wanted to report back to this thread.  I've had a frustrating
experience trying to figure out what's going on.  Everything worked
fine for about a week, but I still get the occasional frequent crash
symptoms.  It looks like it's going to take some time to figure out
what's going on.  If I find anything out, I'll post back.

wes