Subject: Re: select / poll per proc or lwp?
To: None <M.Drochner@fz-juelich.de>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: tech-kern
Date: 04/15/2003 20:42:59
Matthias Drochner wrote:
> This might save a bit of code because comparing a PID is cheaper than
> comparing both PID/LID, and it might be a bit more effective if two
> threads of one application are polling for the same file descriptor
> because a collision is avoided in that case.
> In general however it looks like a waste.
> 
> Comments / opinions?
> 
> I'll append a patch which implements such a change. For a real
> implementation, the lwp pointer would have to be passed through
> the fileops.

Looks fine.

I think you can keep using curlwp, it should be always TRT in
selrecord() context. Add KASSERT(selector == curproc) to be sure tho :)

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.org/
-=- We should be mindful of the potential goal, but as the tantric    -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow.   Do not let this distract you.''     -=-