async queue?



On Mon, Dec 10, 2001 at 10:27:57PM -0800, rsteinke w-link net wrote:
> If you're interested in contributing, keep at it. A good first step
> would be to download 1.3, either as a tarball or straight from CVS,
> to see where development is currently at.

What of modifications such as the following?

1) The Async Queue code does not appear to deal with the traditional
   producer/consumer problem where the producer is able to produce
   (queue) items faster than the consumer can consume (dequeue) items.

   The result is that a lot of memory gets chewed up, when perhaps
   a maximum queue size should block the producer until the consumer
   has consumed a few of the items. The consumer will certainly have
   trouble consuming if the producer is hogging a significant portion
   of the CPU, and loading up memory in the process. This can be
   implemented as a single value that push() will block on, or a single
   value that push() will block on, until the queue is reduced to a
   certain size (high and low water mark).

   I can write a small C program to prove this, if it would be useful.

2) The Async Queue code should actually use two conditionials instead
   of one after implementing the above code. One conditional is used
   to wake up threads that are waiting to pop, while the other conditional
   is used to wake up threads that are waiting to push.

mark

-- 
mark mielke cc/markm ncf ca/markm nortelnetworks com __________________________
.  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Neighbourhood Coder
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | 
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, Ontario, Canada

  One ring to rule them all, one ring to find them, one ring to bring them all
                       and in the darkness bind them...

                           http://mark.mielke.cc/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]