|
Boost Users : |
Subject: Re: [Boost-users] Does lock-less queue wait on empty queue ?
From: Sebastian Messerschmidt (sebastian.messerschmidt_at_[hidden])
Date: 2015-05-18 09:02:07
Am 18.05.2015 um 13:51 schrieb Ran Shalit:
> Hello,
>
> I'm newbie of boost library.
>
> I would like to ask if the lockless queue waits on empty queue ? (I
> actually need it to wait).
You can easily wait yourself, and everyone would want to wait
differently, so there is no point in putting into the queue's
implementation.
For instance you could give up your scheduler time-slice, or you might
want to spin-lock
while(!queue.pop(my_data))
{
boost::this_thread::yield(); //give up time slice
}
//tight waiting
while(!queue.pop(my_data))
{
//spin
}
>
> And another thing: Can the Pool library be build separately, so that I
> can use only the boost/pool files or do I need to use all boost
> sources in order to build just the pool.
Boost lockfree seems to be header only, but I'm not so sure about its
dependencies.
Maybe someone can drop in here.
Cheers
Sebastian
>
> Thank you,
> Ran
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
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