in reply to Re^4: Sharing sockets between the main script and thread
in thread Sharing sockets between the main script and thread
There actually is a bonus question .... If you run the server .... Everything will hang.
Maybe it's a platform difference, but I commented out the select at the top, and then the sleep at the bottom, and nothing changed. No hang. Everything just ran a little faster.
As for the code. You are using a shared hash, locking, and two queues to achieve what this code achieves with a single queue and no locking. And for no benefit that I can perceive.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Sharing sockets between the main script and thread
by markseger (Beadle) on Nov 30, 2008 at 16:01 UTC | |
by BrowserUk (Patriarch) on Nov 30, 2008 at 16:09 UTC | |
by markseger (Beadle) on Nov 30, 2008 at 17:14 UTC |