
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Zeljko Vrba Sent: 17 March 2008 15:04 To: boost-users@lists.boost.org Subject: Re: [Boost-users] Threads Don't Take Turns Under Linux (UbuntuGutsy Gibbon)
On Mon, Mar 17, 2008 at 09:42:46AM -0400, Hal Vaughan wrote:
Am I doing something wrong or is there a setting I need to change?
That's normal behavior; threads are scheduled by the OS. In your case, the thread fills the buffer faster then its timeslice expires, so you see buffer being filled/emptied in "batches". If you want them to be interleaved, lower the buffer size or try running on an SMP machine.
Or put a usleep(0) in the thread to force the timeslice to expire? IIRC. James This message (including any attachments) contains confidential and/or proprietary information intended only for the addressee. Any unauthorized disclosure, copying, distribution or reliance on the contents of this information is strictly prohibited and may constitute a violation of law. If you are not the intended recipient, please notify the sender immediately by responding to this e-mail, and delete the message from your system. If you have any questions about this e-mail please notify the sender immediately.