Subject: Re: workqueue(9), per-CPU queues (part 2)
To: None <rmind@NetBSD.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 07/26/2007 08:49:41
> While here...
> I was thinking about adding few functions to the API. Currently, there are no
> correct way to handle if work was done. What about adding something like this:
> 
>   int workqueue_wait(struct workqueue *wq, u_int timo);
> 
> It would wait while work will be processed (or timeout occurs, if set) i.e.
> cv_timedwait() and cv_broadcast() in the worker. These would be called only if
> some WQ_USINGWAIT flag would be set.
> 
>   bool wokqueue_empty(struct workqueue *wq);
> 
> Checks if queue is empty. Maybe instead of this, something like
> workqueue_count() would be better (to get the count of active works).
> 
> Would this be reasonable? Or it adds too much additional overhead, and should
> be implemented in the caller's structure?
> 
> -- 
> Best regards,
> Mindaugas
> www.NetBSD.org

i'm curious what actually needs these functionalities.

when i wrote it, i tried to make the worker code minimum and intentionally
omitted functionalities which can be implemented in the caller.
it doesn't mean i will automatically object against them, tho. :)

YAMAMOTO Takashi