public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: pthread: thread switching bug?
@ 2001-11-02 15:49 Heribert Dahms
  2001-11-02 18:38 ` Christopher Faylor
  0 siblings, 1 reply; 8+ messages in thread
From: Heribert Dahms @ 2001-11-02 15:49 UTC (permalink / raw)
  To: 'Robert Collins', cygwin

Hi Rob,

I'd expect write() to be atomic, if "small" enough, but not print() or
fprintf()!

I once more cite APUE
(Richard W. Steven's Advanced Programming in the UNIX Environment),
chapter 10.6 Reentrant Functions:
"Most implementations of the standard I/O library
use global data structures in a nonreentrant way"
right under figure 10.3:
Reentrant functions that may be called from a signal handler.

Methinks this precaution applies also to MT!


Bye, Heribert (heribert_dahms@icon-scm.com)

> -----Original Message-----
> From:	Robert Collins [SMTP:robert.collins@itdomain.com.au]
> Sent:	Thursday, November 01, 2001 03:38
> To:	cygwin@cygwin.com
> Subject:	RE: pthread: thread switching bug?
> 
> > -----Original Message-----
> > From: Christopher Faylor [ mailto:cgf@redhat.com ]
> > >Thanks for the testing, you've shown that there is non 
> > thread safe code,
> > >probably in the fhandler_consoler in cygwin, or possibly in the MS
> > >Windows console code. Right now we don't know which.
> > 
> > I'm still not sure why this is a cygwin bug.  Is there some 
> > requirement
> > that writes to the console be atomic?  Your (Robert's) original email
> > indicated that the Opengroup spec didn't have this as a requirement.
> 
> It's non expected behaviour at the least. At worst it could be a symptom
> of something more serious that is faulty. I intend to analyse it at some
> point. 
> 
> The Opengroup spec for printf doesn't document any thead safety needs,
> but, one would expect fprintf to a file to be atomic regardless of the
> actual file... There are separate thread considerations elsewhere in
> that tome, but I don't have time to dig them up right now.
> 
> Rob
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: pthread: thread switching bug?
@ 2001-10-31 18:30 Robert Collins
  2001-10-31 18:36 ` Christopher Faylor
  0 siblings, 1 reply; 8+ messages in thread
From: Robert Collins @ 2001-10-31 18:30 UTC (permalink / raw)
  To: cygwin

> -----Original Message-----
> From: Christopher Faylor [ mailto:cgf@redhat.com ]
> >Thanks for the testing, you've shown that there is non 
> thread safe code,
> >probably in the fhandler_consoler in cygwin, or possibly in the MS
> >Windows console code. Right now we don't know which.
> 
> I'm still not sure why this is a cygwin bug.  Is there some 
> requirement
> that writes to the console be atomic?  Your (Robert's) original email
> indicated that the Opengroup spec didn't have this as a requirement.

It's non expected behaviour at the least. At worst it could be a symptom
of something more serious that is faulty. I intend to analyse it at some
point. 

The Opengroup spec for printf doesn't document any thead safety needs,
but, one would expect fprintf to a file to be atomic regardless of the
actual file... There are separate thread considerations elsewhere in
that tome, but I don't have time to dig them up right now.

Rob

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <3BCCB65E.77D66FE2@hszk.bme.hu>]

end of thread, other threads:[~2001-11-02 18:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-02 15:49 pthread: thread switching bug? Heribert Dahms
2001-11-02 18:38 ` Christopher Faylor
  -- strict thread matches above, loose matches on Subject: below --
2001-10-31 18:30 Robert Collins
2001-10-31 18:36 ` Christopher Faylor
     [not found] <3BCCB65E.77D66FE2@hszk.bme.hu>
2001-10-16 17:36 ` Christopher Faylor
2001-10-21  4:57   ` Robert Collins
     [not found]     ` <3BD72CC1.B2BF80D7@hszk.bme.hu>
2001-10-31 15:40       ` Robert Collins
2001-10-31 18:27         ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).