locking in a device driver
M. Warner Losh
imp at bsdimp.com
Wed Nov 2 13:19:32 PST 2005
In message: <43692719.90805 at alphaque.com>
Dinesh Nair <dinesh at alphaque.com> writes:
:
:
: On 11/03/05 03:12 Warner Losh said the following:
: > Yes. if you tsleep with signals enabled, the periodic timer will go
: > off, and you'll return early. This typically isn't what you want
: > either.
:
: looks like i've got a lot of work to do, poring thru all the ioctls for the
: device and trying to use another method to wait instead of tsleep().
If you have to run on 4.x, that may be the case. The other way around
this is to create a helper program that gets the ioctl request over a
pipe or socket, does the call to the kernel and then returns the
results. Not idea, I'll grant, but it is an alternative worth
thinking about if the number of ioctls is large and the impact of
conversion to read/write channels is big.
: > works. If you use libc_r on 5, you'll see exactly this behavior. If
: > you use libpthread or libthr, you won't.
:
: i use gcc -pthread, so it's libc_r on 4.x. what does 'gcc -pthread' link to
: on 5.x ?
libpthread by default, others if you use libmap.conf
Warner
More information about the freebsd-hackers
mailing list