Boost Users :
Subject: Re: [Boost-users] [Review] Lockfree review starts today, July 18th
From: Bill Buklis (boostusr_at_[hidden])
Date: 2011-07-18 12:51:49
On 7/18/2011 9:51 AM, Klaim - Joël Lamotte wrote:
> On Mon, Jul 18, 2011 at 15:32, Hartmut Kaiser
> <hartmut.kaiser_at_[hidden] <mailto:hartmut.kaiser_at_[hidden]>> wrote:
> - What is your evaluation of the documentation?
> Just a minor request so far :
> If I remember correctly (and I might be very wrong as my memory is
> really not clear on this point), the presentation at boostcon started
> by explaining why lockfree data structures should be used only in last
> resort or something like that.
> Maybe a documentation page with such explainations would help the user
> know if it there are better solutions for their cases? I read that the
> main purpose is comunication between threads.
> Joël Lamotte
One case where I use a lock-free data structure is with high performance
network communications in which the client app receives tremendous
amounts of data. The app has a thread dedicated to receiving data and
another thread dedicated to processing the data. It uses a fixed size
lock-free circular buffer to hold the data. In terms of boost::lockfree,
this would be akin to the fifo queue. Using a circular queue prevents
memory allocations, but does limit the amount of stored data making it
critical that the processing thread reasonably keep up. Having a
lock-free data structure definitely helps with performance.
I haven't looked at boost::lockfree yet, but I'm very curious to know
how the fifo queue compares. Perhaps adding a circular queue version to
lockfree would be beneficial. The implementation is fairly trivial. I
don't even use atomic operations for it (at least on Windows). Although
perhaps they may be needed for other platforms.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net