|We don't bite newbies here... much|
Re: threads->create() blocks on Windowsby BrowserUk (Pope)
|on Mar 17, 2014 at 20:21 UTC||Need Help??|
Your first thread puts the socket into a blocking read state.
When you attempt to start the second thread, Perl tries to clone $s for that thread, because it closes over $s.
But, the underlying system handle for the socket is locked (by the OS) because the socket is in a blocking read; thus the attempt to clone the handle is blocked until the read completes; which it never will.
As the clone is blocked, the second thread is never started; so no GET is issued, so no reply will be received.
The solution (maybe, depending upon the rest of your application,) it to ensure the get occurs before the read state is entered.
Something like this:
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.