Re: async queue?



le mar 11-12-2001 à 14:33, Mark Mielke a écrit :
> One mutex, and two conditionals, as opposed to one mutex and one
> conditional. For 'overhead', it's only a few extra bytes to ensure
> that one thread doesn't runaway, while the other thread makes its
> best effort to compete.

The "overhead" is in the system call. I personally do not consider this
to be "overhead". I was merely playing devil's advocate for those who
consider threads to be _evil_.

> 
> > As a side note, you refered to the "Async Queue" and what you want is a
> > "Sync Queue" so, I guess you definitely should create your own version
> > of a "Sync Queue"
> 
> This is rather interesting of a suggestion, however I'm not certain
> that it is correct. I don't want a 'sync queue', except under the
> situation that the 'async queue' would grow without bounds.

Well, this is the definition of a sync queue for me: a queue which has a
maximum size and which blocks when it reaches that size and a minimum
size (emptiness obviously) and which blocks when it reaches that size.
It is effectively synchronous. I guess you probably have another
definition...

Mathieu
-- 
Mathieu Lacage <mathieu gnu org>




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