Re: locking in a device driver

From: M. Warner Losh (imp_at_bsdimp.com)
Date: 11/01/05

  • Next message: Tillman Hodgson: "Re: [FreeBSD-Announce] New Logo"
    Date: Tue, 01 Nov 2005 09:02:12 -0700 (MST)
    To: dinesh@alphaque.com
    
    

    In message: <43676121.4030801@alphaque.com>
                Dinesh Nair <dinesh@alphaque.com> writes:
    :
    :
    : On 10/28/05 16:40 Dinesh Nair said the following:
    : >
    : >
    : > On 10/28/05 10:52 M. Warner Losh said the following:
    : >
    : >> libc_r will block all other threads in the application while an ioctl
    : >> executes. libpthread and libthr won't. I've had several bugs at work
    : >
    : >
    : > which is a Good Thing(tm) indeed for me on 4.x.
    :
    : which may not be a Good Thing(tm) after all. this could be causing the
    : problem i'm seeing with the driver on 4.x. any methods to get around this,
    : short of not using threads ?

    Use non-blocking I/O + read/write channels + select/poll instead of
    ioctl for things you want to block. Your thread can then read/write
    to that channel, and since the treading package does the select behind
    the scenes, it will be good for you.

    Warner
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: Tillman Hodgson: "Re: [FreeBSD-Announce] New Logo"