[Pianod] wsgw hanging on RasPi; deadlock?
Perette Barella
perette at barella.org
Mon Feb 25 15:39:48 PST 2013
By completion flags, were you thinking like a bool that either thread could set and the main could watch? That would require the main thread to keep running and monitoring, whereas with the mutex solution, main doesn't have to spin. If this wasn't what you were thinking, I'd be curious for details of your idea. I'm new to pthreads too, so you may be onto something I don't know about.
Perette
On 2013年02月25日, at 18:29, Peter Li wrote:
> Right, because you want to shut the whole thing down when either thread finishes, not wait for both. And I suppose a mutex is more efficient than simply putting completion flags on each thread and then waiting for them?
>
>
> On 02/25/2013 03:20 PM, Perette Barella wrote:
>> Nice catches on the subtle bugs.
>>
>> The reason for the goofy mutexes instead of pthread_join is so when one direction closes, the other isn't left hanging. I'll comment that. There should be a pthread_joins after the thread cancellations, though, I'll add that and make a release.
>>
>> Perette
> _______________________________________________
> Pianod mailing list
> Pianod at lists.deviousfish.com
> http://lists.deviousfish.com/listinfo.cgi/pianod-deviousfish.com
More information about the Pianod
mailing list