Kenosis wrote:
> ara.t.howard / noaa.gov wrote:
> > On Sat, 16 Dec 2006, Tim Pease wrote:
> >
> > > On 12/15/06, ara.t.howard / noaa.gov <ara.t.howard / noaa.gov> wrote:
> > >>
> > >> a) io and threads to not work together in the one-click installer
> > >>
> > >
> > > Curious about this one -- especially in light of (c) below.  If the
> > > msys compiler can get this right, why do the MS compilers break
> > > threads like this?  It makes no sense that all threads should get
> > > stuck until an IO call gets handled :/
> > >
> > >>
> > >> b) cygwin does
> > >>
> > >> c) msys compiled ruby does
> > >>
> > >
> > > Thanks for the answer, though :)
> >
> > throw an strace on the one-click and cyg-ruby and see.  i'd be curious what's
> > different.
> >
> > -a
> > --
> > if you find yourself slandering anybody, first imagine that your mouth is
> > filled with excrement.  it will break you of the habit quickly enough. - the
> > dalai lama
>
> I had this problem on a project a couple of years back and the
> conclusion of those who helped me from this group was that the io on
> stdin was blocking all threads other threads while the thread with the
> stdin io (gets) waited for input. I seem to recall someone saying that
> this prevented two or more threads from trying to read from stdio at
> the same time.  Does this still ring true/correct?  And the work around
> as I recall was to use a windows system call to check for input being
> ready before the thread tried to read from stdin so the others were
> blocked as little as possible.
>
> Ken
>
> PS. I searched for that discussion here but I can't recall the user
> name I had at the time and thus came up empty.  Hope this helps some.

PPS. And this only occurred on Windoz, not *nix.