[Pianod] wsgw hanging on RasPi; deadlock?
Perette Barella
perette at barella.org
Mon Feb 25 15:20:32 PST 2013
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
On 2013年02月25日, at 18:09, Peter Li wrote:
> Okay, I fixed a couple of putative bugs. The clientbuf/serverbuf one seemed to be the cause of the hanging. I guess on my desktop (and your setup) the client_to_server thread gets started early enough that it wasn't causing a problem, but on the RasPi the server_to_client thread instructions were getting moved in front so that the bug was unmasked.
>
> In the course of tracking this down, I also tried changing the mutex setup to a simple pthread_join(client_id); pthread_join(server_id); and that seemed to work fine. Not including the patches but I can send if you want; it seems like a nicer way to handle things?
>
> Also now that the clientbuf/serverbuf are seemingly disentangled from each others' threads, would probably make sense to create and free those buffers from within their own threads?
>
> I'm a little bit guessing here, but since it seems to work with the patch below I think the above is correct.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.deviousfish.com/pipermail/pianod-deviousfish.com/attachments/20130225/0c9cf1ff/attachment-0003.htm>
More information about the Pianod
mailing list