Date: Tue, 24 Nov 2020 09:30:26 +0200 From: Lari Sihto <lari.sihto@gmail.com> To: "Kevin P. Neal" <kpn@neutralgood.org> Cc: freebsd-questions@freebsd.org Subject: Re: kernel threads Message-ID: <CAA-cghW6Cs6m3v_1H9ii0R=B9U=OX30zbRX08sWgm=LN6ZLt2g@mail.gmail.com> In-Reply-To: <X7xzFwjF422sM1b0@neutralgood.org> References: <CAA-cghUBT1ZSMqE7HoR%2BCDBsm7zjBTyE3KM4AeOmJ_V_GOnTmw@mail.gmail.com> <X7rfngQzAIJjxw7X@neutralgood.org> <CAA-cghWSzYj-d-pkXUbZvXQZB5Ozd1VbhXz6X=dryXhSfDSMPw@mail.gmail.com> <X7xzFwjF422sM1b0@neutralgood.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Ok, thanks for the clarification. ti 24. marrask. 2020 klo 4.42 Kevin P. Neal (kpn@neutralgood.org) kirjoitti: > On Mon, Nov 23, 2020 at 07:17:50AM +0200, Lari Sihto wrote: > > Yes, that's it. Do you know why the top half is allowed to sleep but the > > bottom half is not? > > The bottom half is hardware interrupt driven. The top half is entered via > system calls or traps on behalf of the process/thread. If you have a > process > or thread context you can sleep and therefore yield to another process or > thread. Interrupts don't have that luxury. The bottom half isn't part of > any process or thread. So no sleeping is allowed in the bottom half. > > > ma 23. marrask. 2020 klo 0.01 Kevin P. Neal (kpn@neutralgood.org) > kirjoitti: > > > > > On Sun, Nov 22, 2020 at 09:59:57PM +0200, Lari Sihto wrote: > > > > Hi, just wondering if there is some technical or philosophical > reason as > > > to > > > > why the freebsd operating system doesn't seem to use kernel-space > threads > > > > like some other unix-like operating systems do. To my knowledge the > need > > > > for kernel threads arises when the kernel code needs to sleep in > kernel > > > > which one cannot do. Kernel threads seem to fix that problem. Have > been > > > > wondering this for a long time and I hope someone here knows the > > > reasoning > > > > behind this implementation detail be it just performance related or > > > > something along the line of "no-one just haven't been up to > implementing > > > > that kind of a functionality"? > > > > > > Are you thinking of something different than what is described in the > > > kthread(9) and kproc(9) man pages? > > > > > > Also, my limited understanding is that the "top" half of the kernel is > > > allowed to sleep, but the "bottom" half is not. > > > > > > You'll get more informed responses to this topic on the freebsd-arch, > > > freebsd-hackers, or maybe freebsd-current lists. Very few if any kernel > > > hackers hang out on this list. > -- > Kevin P. Neal http://www.pobox.com/~kpn/ > > Seen on bottom of IBM part number 1887724: > DO NOT EXPOSE MOUSE PAD TO DIRECT SUNLIGHT FOR EXTENDED PERIODS OF TIME. >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAA-cghW6Cs6m3v_1H9ii0R=B9U=OX30zbRX08sWgm=LN6ZLt2g>