From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Collins To: cygwin@cygwin.com Cc: Nemeth Marton Subject: Re: pthread: thread switching bug? Date: Sun, 21 Oct 2001 04:57:00 -0000 Message-id: <1003665677.2183.50.camel@lifelesswks> References: <3BCCB65E.77D66FE2@hszk.bme.hu> <20011016203656.A30680@redhat.com> X-SW-Source: 2001-10/msg01202.html 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/