Re: Nagios and threads

From: Kamal R. Prasad (kamalpr_at_yahoo.com)
Date: 06/23/05

  • Next message: Andrey Simonenko: "Question about synchronization in socow_setup()"
    Date: Thu, 23 Jun 2005 02:25:45 -0700 (PDT)
    To: Daniel Eischen <deischen@freebsd.org>, Peter Edwards <peadar.edwards@gmail.com>
    
    

    --- Daniel Eischen <deischen@freebsd.org> wrote:

    > On Wed, 22 Jun 2005, Peter Edwards wrote:
    >
    > > On 6/22/05, Kamal R. Prasad <kamalpr@yahoo.com>
    > wrote:
    > > >
    > > > The child process should be able to call any
    > system
    > > > calls it likes -without assuming that pthreads
    > from
    > > > the parent process have been copied over to the
    > child
    > > > process. I spose most implementations support
    > that.
    > > >
    > >
    > > There's more to it than system calls, though (most
    > (all?) of which
    > > will be async-signal-safe anyway). Simple example:
    > any lock that the
    > > libc implementation needs to provide its
    > functionality may be
    > > arbitrarily locked by some other thread: eg, one
    > thread calls malloc()
    > > as another calls fork(): the original thread
    > ceases to exist in the
    > > child while holding a lock in malloc, leaving
    > malloc() unusable in the
    > > process.
    >
    How about doing some cleanup in a pthread_atfork()
    routine? It can be done by the user or a libc/X stub
    that gets called implicitly.

    > We do protect the malloc lock across a fork(), but
    > that's it.
    >
    Isn't it possible that an application may genuinely
    want to fork() out a child and not exec() another
    process.?

    regards
    -kamal

    > --
    > DE
    >
    >

    ------------------------------------------------------------
    Kamal R. Prasad
    UNIX systems consultant
    http://members.fortunecity.com/kamalp
    kamalp@acm.org

    In theory, there is no difference between theory and practice. In practice, there is.
    ------------------------------------------------------------

    __________________________________________________
    Do You Yahoo!?
    Tired of spam? Yahoo! Mail has the best spam protection around
    http://mail.yahoo.com
    _______________________________________________
    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: Andrey Simonenko: "Question about synchronization in socow_setup()"

    Relevant Pages

    • Question about building perl-5.8.5 multi-threaded on RedHat 9 Linux
      ... obtained initial lock ... child obtained lock ... ok 18 - cond_wait [twain]: ... timeout: ...
      (comp.lang.perl.misc)
    • Re: Why Sony Will Die
      ... save for having used a codec and DRM which Microsoft developed. ... It's not the player that was the problem...it was the DRM system. ... I suppose when you buy a lock at the hardware store ... "Perfect for locking a child in a closet!" ...
      (alt.tv.tech.hdtv)
    • Re: TurboIMAGE: Timed lock request
      ... Since my previous posting I already tried this out and yes, the child gets ... Too bad junior can't give the lock to daddy. ... Subject: TurboIMAGE: Timed lock request ... To join/leave the list, search archives, change list settings, * ...
      (comp.sys.hp.mpe)
    • Re: TurboIMAGE: Timed lock request
      ... When a parent process is aborted, it issues an abort against it's child processas part of the parent's termination handling and waits for them to complete prior to the parent completing it's termination. ... When awoken thru the dispatch process, the processing checks this flag and if set, calls terminate. ... Too bad junior can't give the lock to daddy. ... Subject: TurboIMAGE: Timed lock request ...
      (comp.sys.hp.mpe)
    • Re: Why Sony Will Die
      ... It's not the player that was the problem...it was the DRM system. ... I suppose when you buy a lock at the hardware store ... "Perfect for locking a child in a closet!" ... How about the fact that they call it "Media Digital Rights ...
      (alt.tv.tech.hdtv)