Boost logo

Boost :

Subject: Re: [boost] [interprocess] difference in timed_wait behavior under linux and windows
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2008-09-20 07:42:17

Sergei Politov wrote:
> Hello,
> On Fri, Sep 19, 2008 at 9:30 PM, Ion Gaztañaga <igaztanaga_at_[hidden]> wrote:
>> Thanks for the report. I just didn't know pos_infin was there. I would need
>> to call non-timed versions when pos_infin is used. That would be correct,
>> wouldn't it?
> Yep, I did it in the same way.


> There is one more thing, I want to discuss.
> I have done some performance tests of my "stream transporter" class that
> uses shared_memory, interprocess_condition, interprocess_mutex.
> And windows version was 2.5 times faster than linux.
> When I turned linux version to BOOST_INTERPROCESS_USE_GENERIC_EMULATION it
> produced the same speed.
> The problem is that I had to edit boost header files to do so.

Ok. Generic emulation uses atomic operations to emulate locks and
condition variables. The problem with generic emulation is that
condition variables don't sleep, they spin (with yield()). For some
applications that use mutexes without high contention, generic emulation
is faster. For other applications, this might not be true. Anyway, I
think it's fair to offer an option to force the use of generic
emulation. Thanks for the idea!

> Best Regards,
> Sergei



Boost list run by bdawes at, gregod at, cpdaniel at, john at