Of course, I tested my code before I post it. Before you question whether I tested my code, you better try my code out first. Everyone should only speak base on facts, not guesses.

Your threaded code does not work, does not imply all threaded code do not work.

But I will be happy to look into your code, and see why it is stuck. I will do this now.

Still looking at your code... First your code exited right after I started it. Reason? simple, because after it created two child threads, your main thread just print "bye" and exit. How did you test your code? I will add joins before bye.

...

Okay, tested your code. It died on you? Sorry it worked for me, after added:
threads::join($thra); threads::join($thrb);
Couple of things about your code:
  1. You use $BUFFER without check whether it is undef, that causes lots of warning, when you do length($BUFFER) etc.
  2. You better lock your shared variables before update them, although in your context, this not that serious a problem

In reply to Re: Re: Re: Select on STDIN or ALARM?! For Win32 doesn't work! by pg
in thread Select on STDIN or ALARM?! For Win32 doesn't work! by gmpassos

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.