|
Boost : |
Subject: Re: [boost] [lockfree] how many items are queued?
From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2009-09-04 05:10:01
Manuel Fiorelli wrote:
> 2009/9/4 Tim Blechmann <tim_at_[hidden]>:
>>>>> lockfree.fifo provides the info if the queue is empty or not.
>>>>
>>>> it is mainly done as debugging help, but it is not supposed to be
>>>> used in concurrent code ...
>>>
>>> Because this function is available I thought it is safe to used it.
>>
>> well, there is a warning in the docs, noting, that this function is
>> not thread-safe :)
>
> I didn't look at your library, but I think that this decision is
> dangerous. I think that this debug functionalities should be enabled
> only if explicitly required by the user, who is assumed to know what
> is doing.
There is precedence in form of shared_ptr<T>::use_count().
/ Johan
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk