Re: "sleep" "select" system call not work correctly when linkingwith multithread libray--FreeBSD 4.5

From: M. Warner Losh (imp_at_bsdimp.com)
Date: 02/25/05

  • Next message: Seán C. Farley: "Re: setenv/unsetenv's known memory leak"
    Date: Thu, 24 Feb 2005 19:15:44 -0700 (MST)
    To: river_robert@yahoo.com.cn
    
    

    In message: <200502250205.j1P25hEU004737@rover.village.org>
                "River" <river_robert@yahoo.com.cn> writes:
    : Many thanks for your reply. Did the lastest FreeBSD fix this bug?
    : And which version?

    I believe that 5 fixes this bug, or at least mostly fixes things
    (since there's at least one pthread API that uses absolute time).
    However, I've not verified this on 5.

    : Because our OS is based on FreeBSD 4.5 and can not port to other
    : FreeBSD easily, Any method to fix it in 4.5? Thanks.

    The only fix that I could come up with was to base everything on
    uptime rather than system time. However, I ran into snags because the
    pthread's API is stupid:

         int
         pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
             const struct timespec *abstime);

    abstime is lame, because it doesn't cope well with system time
    changing.

    Your best bet is to make sure that the system time doesn't step after
    your application starts. This means you'll likely need to wait for
    ntpd to step the time, or use ntpdate to get things close and tell
    ntpd not to step things.

    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: Seán C. Farley: "Re: setenv/unsetenv's known memory leak"

    Relevant Pages

    • Re: FreeBSD 5.3-BETA7 available
      ... The FreeBSD Release Engineering Team is proud to announce the ... those wishing to help find and/or fix bugs. ... Other fixes and enhancements made since BETA6: ... - Add support to the fxp driver for the ICH6 chipset. ...
      (freebsd-current)
    • Webmail Message
      ... The FreeBSD Release Engineering Team is proud to announce ... early adopters and those wishing to help find and/or fix ... Other fixes and enhancements made since BETA7: ... - Add support to the fxp driver for the ICH6 chipset. ...
      (freebsd-current)
    • upgrade of file(1) to 4.10 (including FreeBSD elf(5) fixes)
      ... This fixes ... and an MFC will fix the problems of FreeBSD 4.10 being identified as ...
      (freebsd-current)
    • Re: Differences between GNU and FreeBSD C library
      ... problems if the code you are porting relies on non-portable ... Even if you're not up to submitting a fix for the problem yet, ... a precise description of where FreeBSD departs from ... bug reports which also include a patch are very ...
      (comp.unix.bsd.freebsd.misc)
    • Re: Bug in #! processing - One More Time
      ... So I wrote up a quick fix and did ... > but I didn't want to commit it until I did more testing, ... > options on the shebang line the way FreeBSD does. ... > documented by perl (and other scripting languages), ...
      (freebsd-arch)