
What's IMHO the correct response for empty(), size(), and other (non- thread-safe) functions is to document explicitly:
bool empty() const; // Return whether a *snapshot* of this queue is empty.
size_t size() const; // Return a *snapshot* of the size of this queue.
i see your point, but i doubt, it can be implemented correctly (at least with double-word cas primitives). the only possibility, that i see, is providing methods for upper and lower bounds using atomic integers that are incremented/decremented before/after the linearization points ... i will see, maybe it is possible to provide this facility based on template arguments. i don't want to add this to the default interface, since atomic operations require some hardware synchronization, which aren't really lightweight ... cheers, tim -- tim@klingt.org http://tim.klingt.org You don't have to call it music if the term shocks you. John Cage