Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Apr 2003 10:58:26 -0700
From:      Lev Walkin <vlm@netli.com>
To:        "Kevin A. Pieckiel" <kpieckiel-freebsd-hackers@smartrafficenter.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: kqueue events
Message-ID:  <3EA582C2.1040102@netli.com>
In-Reply-To: <20030418214013.GA65290@pacer.dmz.smartrafficenter.org>
References:  <20030418214013.GA65290@pacer.dmz.smartrafficenter.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Kevin A. Pieckiel wrote:
> Will the kqueue interface work with pthread ID's, or is it limited
> only to system process ID's?  If it doesn't work with pthread ID's,
> how much trouble is it to modify them and add a pthread ID filter?

What are you trying to achieve, by the way?


Basically, for the FBSD versions < 5.0 there are two forms of
threads available: basic (libc_r) pthreads and linuxthreads from ports.

The first type (user-level threads) does the context switching and
all the relevant thread management stuff in the user space, so kernel
just doesn't have enough information to supply any kind of per-thread-ID
notifications with kqueue system call. However, kqueue wrapper in
libc_r could be enhanced to support this kind of stuff (it would be
a purely user-level library hack).

The second type (rfork()-based) is slightly better for you: kqueue
should support this natively (system pids are different per each
"thread"), and you don't have to modify any default libraries and/or
kernel.

For 5.0 it seems to be quite a bit more complicated task in every
respect.


-- 
Lev Walkin
vlm@netli.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3EA582C2.1040102>