delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/11/02/18:49:13

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <BF35D9C143BCCC4EB63181B67C9320C804DEAD@serv-075.icon-germany.local>
From: Heribert Dahms <heribert_dahms AT icon-scm DOT com>
To: "'Robert Collins'" <robert DOT collins AT itdomain DOT com DOT au>, cygwin AT cygwin DOT com
Subject: RE: pthread: thread switching bug?
Date: Sat, 3 Nov 2001 00:50:06 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)

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 AT icon-scm DOT com)

> -----Original Message-----
> From:	Robert Collins [SMTP:robert DOT collins AT itdomain DOT com DOT au]
> Sent:	Thursday, November 01, 2001 03:38
> To:	cygwin AT cygwin DOT com
> Subject:	RE: pthread: thread switching bug?
> 
> > -----Original Message-----
> > From: Christopher Faylor [mailto:cgf AT redhat DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019