Page faults and threads

Alejandro Imass ait at p2ee.org
Wed Dec 8 17:18:06 UTC 2010


On Wed, Dec 8, 2010 at 2:08 AM, Mark Terribile <materribile at yahoo.com> wrote:
>
> Hi,
>
> Can anyone tell me: when a thread hits a page fault in a multithread program on FreeBSD, is the entire program stopped waiting for the page to be loaded/made ready or just the one thread?
>
> Has this changed in recent versions with the changes to the scheduler?
>
> And, if you know, do other Open-Source OS's do the same thing, or are they all different?
>

By no means an expert but i think your question is way too broad for a
single answer so IMHO it depends on many things like FBSD version,
type of threading you are using and how. A short summary to best of my
knowledge is that the threading models in FBSD have changed broadly
and continuously since FBSD 5 so it really depends...

In general I would think that if the model/lib you are using is 1:1
(default from FBSD 7, I think) then a page fault should halt a single
thread and no other threads should be affected if no mem is shared
between them, although since threads may(usually?) share memory in
most popular models (1:1, N:1, N:M) the fault should block all threads
that share that memory space. In any case the issue of page faults and
blocking is more related to the VM than to the scheduler, again to the
best of my knowledge, and there should be a bunch of sysctls to
fine-tune / tweak the behavior.

The topic is quite interesting to me, sadly don't know enough about
the matter (though I use mod_perl/mod_worker a lot on FBSD so I know
just enough to get by) and it would be great if some experts jump in
and shed some light on the current threading implementations on the 7,
8 and 9 releases. Furthermore, (knowingly a bit OT to the OP) and if
some Perl on FBSD experts on this list (merlyn?) would also give their
.02 on Perl threading options/details on FBSD 7,8,9 would be even
better ;-)

best,
--
Alejandro Imass

>    Mark Terribile
>
>
>
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
>


More information about the freebsd-questions mailing list