Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Subject: Re: pthread: thread switching bug? From: Robert Collins To: cygwin AT cygwin DOT com Cc: Nemeth Marton In-Reply-To: <20011016203656.A30680@redhat.com> References: <3BCCB65E DOT 77D66FE2 AT hszk DOT bme DOT hu> <20011016203656 DOT A30680 AT redhat DOT com> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Evolution/0.13 (Preview Release) Date: 21 Oct 2001 22:01:16 +1000 Message-Id: <1003665677.2183.50.camel@lifelesswks> Mime-Version: 1.0 X-OriginalArrivalTime: 21 Oct 2001 12:06:01.0852 (UTC) FILETIME=[C0899BC0:01C15A28] On Wed, 2001-10-17 at 10:36, Christopher Faylor wrote: > Please check out the project web page for links to available information > and ports: http://cygwin.com/ . > > If you don't see what you need there, then the cygwin mailing list is > the best place to make observations or get questions answered. > Information on the mailing list is available at the project web page. > > For your convenience, I've reset the Reply-To: address to point to the > cygwin mailing list. I've also Cc'ed this reply there. > > On Wed, Oct 17, 2001 at 12:36:14AM +0200, Nemeth Marton wrote: > >Hi! > > > >I have written a little program using threads. If I complie with gcc & > >run it under Linux, it works fine. > > > >But when I complied with cygwin's gcc (used versions bellow), and run it > >there was some run where not all the newline characters were on the > >right place, like this: This simply indicates that the printf is not atomic. The Opengroup spec for printf does not indicate atomicity as a requirement. It's certainly not a 'thread switching bug' - thread scheduling is handled via Win32. It *might* be an issue in newlib, or in the cygwin console fd handler, neither of which I've checked yet. Can you see whether you can reproduce the behaviour when writing to a file, not to stdout? (If you are not using fprintf now, start by trying with fprintf (stdout,...)). Let me know via the list whether you can make this happen with a standard file/console with fprintf and we'll take it from there, 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/