Re: In-kernel API for tasks, which could wait?

看板FB_current作者時間14年前 (2011/10/31 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/3 (看更多)
--6B4omjoolujX8zOn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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)? >=20 > I could create thread for this. But it looks strange and too heavy: crea= te thread > to call one function once. >=20 > 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. --6B4omjoolujX8zOn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk6tZ0sACgkQC3+MBN1Mb4guAgCfcYfAru4Fg3QD3rJ4Ww0Zo+Dn RS0AoNfmqRCpOFfzLfD4lfF4c2dftR3x =oMrN -----END PGP SIGNATURE----- --6B4omjoolujX8zOn--
文章代碼(AID): #1EhP3VS_ (FB_current)
文章代碼(AID): #1EhP3VS_ (FB_current)