ion more versatile than just a drain function.
>>
>> Oh I got it. Well, that should work for my cases (bridge, pppoe) because
>> there is just one work. I'm not sure the API suits for other use cases.
>>
>> Anyway I'm trying to implement the API (workqueue_
e work. I'm not sure the API suits for other use cases.
>
> Anyway I'm trying to implement the API (workqueue_wait?).
Here it is: http://www.netbsd.org/~ozaki-r/workqueue_wait.diff
I think that workqueue_drain based on workqueue_wait would be that
workqueue_drain prepares a local work, enqueu
t;> such as mutex and condvar only for that purpose.
>>>
>>> workqueue itself can provide an API to help the routine.
>>> It, say workqueue_drain, waits for all pending works to
>>> finish. With it the caller needs to only ensure that no
>>> new work will
On Thu, Dec 21, 2017 at 5:58 AM, Michael van Elst wrote:
> ozak...@netbsd.org (Ryota Ozaki) writes:
>
>>On Wed, Dec 20, 2017 at 8:06 PM, Michael van Elst wrote:
>>> What about a method that waits for a specific work to complete?
>
>>It might be useful but
On Thu, Dec 21, 2017 at 05:32:58AM +0800, Paul Goyette wrote:
> I'm not totally convinced here. It might be useful to wait for a
> particular work to be finished in order to allow it to be enqueued
> again (no work can be enqueued if already in the queue). But I don't
> see how "remember the
On Thu, Dec 21, 2017 at 05:32:58AM +0800, Paul Goyette wrote:
> again (no work can be enqueued if already in the queue). But I don't
> see how "remember the last work enqueued and wait for it to be done
> before destroying" is more versatile than "waiting for all to be done
> before destroying".
On Wed, 20 Dec 2017, Michael van Elst wrote:
ozak...@netbsd.org (Ryota Ozaki) writes:
On Wed, Dec 20, 2017 at 8:06 PM, Michael van Elst
wrote:
What about a method that waits for a specific work to complete?
It might be useful but how it works in this case?
You
ozak...@netbsd.org (Ryota Ozaki) writes:
>On Wed, Dec 20, 2017 at 8:06 PM, Michael van Elst wrote:
>> What about a method that waits for a specific work to complete?
>It might be useful but how it works in this case?
You could remember the last work enqueued and wait for it
On Wed, Dec 20, 2017 at 8:06 PM, Michael van Elst wrote:
> ozak...@netbsd.org (Ryota Ozaki) writes:
>
>>Here is a patch:
>> http://www.netbsd.org/~ozaki-r/workqueue_drain.diff
>>(I will update workqueue.4 once the proposal is accepted.)
>
> What about a method that waits for
ozak...@netbsd.org (Ryota Ozaki) writes:
>Here is a patch:
> http://www.netbsd.org/~ozaki-r/workqueue_drain.diff
>(I will update workqueue.4 once the proposal is accepted.)
What about a method that waits for a specific work to complete?
--
--
Michael van Elst
t;> such as mutex and condvar only for that purpose.
>>>
>>> workqueue itself can provide an API to help the routine.
>>> It, say workqueue_drain, waits for all pending works to
>>> finish. With it the caller needs to only ensure that no
>>> new work will
called. Currently users of workqueue have
>> to ensure the contract by theirselves. It's possible
>> but it may need to add extra synchronization mechanisms
>> such as mutex and condvar only for that purpose.
>>
>> workqueue itself can provide an API to help the routi
On Wed, 20 Dec 2017, Paul Goyette wrote:
KASSERT_MSG((wq->wg_flags & WQ_DRAINING) != 0,
"adding work to a draining workqueue")
And, of course, that should have been ==, not !=
:)
+--+--++
| Paul Goyette
synchronization mechanisms
such as mutex and condvar only for that purpose.
workqueue itself can provide an API to help the routine.
It, say workqueue_drain, waits for all pending works to
finish. With it the caller needs to only ensure that no
new work will be enqueued.
Here is a patch:
http
and condvar only for that purpose.
workqueue itself can provide an API to help the routine.
It, say workqueue_drain, waits for all pending works to
finish. With it the caller needs to only ensure that no
new work will be enqueued.
Here is a patch:
http://www.netbsd.org/~ozaki-r/workqueue_drain.diff
(I
15 matches
Mail list logo