In-kernel API for tasks, which could wait?
Kostik Belousov
kostikbel at gmail.com
Sun Oct 30 15:03:44 UTC 2011
On Sun, Oct 30, 2011 at 06:54:51PM +0400, Lev Serebryakov wrote:
> So, I have question: what should I do if I need to perofrm ONE
> action, which could block for some time (for example, open file or
> create ALQ)?
>
> I could create thread for this. But it looks strange and too heavy: create thread
> to call one function once.
>
> Maybe, kernel has some API to postpone such task to one,
> always-running idle thread?
See taskqueue(9). On the other hand, waiting for the enqueued task to
finish is itself the sleepable action.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20111030/cd9c1ce1/attachment.pgp
More information about the freebsd-current
mailing list