Professional Web Applications Themes

Issues regarding the Native POSIX Thread library for Linux - UNIX Programming

Ciao guys, I have compiled the 2.6.0 kernel on my Linux machine. I just wrote an application using threads and signals (yes - I posted in october a message on the list I think) and signal catching worked great on my 2.4.22-23 kernels. Now, when I press CTRL+C and send a SIGINT signal to the application, the process simply stops. I briefly summarise my scenario: I applied an unblocking mask to the main thread for the SIGINT, SIGTERM, SIGUSR1 and SIGHUP; I did the same for the child workers (threads) and I issued a dumb thread waiting to catch all ...

  1. #1

    Default Issues regarding the Native POSIX Thread library for Linux

    Ciao guys,

    I have compiled the 2.6.0 kernel on my Linux machine. I just wrote
    an application using threads and signals (yes - I posted in october a
    message on the list I think) and signal catching worked great on my
    2.4.22-23 kernels.

    Now, when I press CTRL+C and send a SIGINT signal to the
    application, the process simply stops.

    I briefly summarise my scenario: I applied an unblocking mask to the
    main thread for the SIGINT, SIGTERM, SIGUSR1 and SIGHUP; I did the same
    for the child workers (threads) and I issued a dumb thread waiting to
    catch all the other signals.

    This worked. Not now. Any ideas?

    Ciao and thank you,
    -Gabriele

    Gabriele Guest

  2. #2

    Default Re: Issues regarding the Native POSIX Thread library for Linux

    In article <btjfi1$8fc$cs.interbusiness.it>, Gabriele Bartolini wrote: 
    Do you have the NTPL userspace ?
    And, with NPTL, signals are not per thread, they are per process.

    --
    Vennlig hilsen/Best Regards
    Nils Olav Selåsdal <NOS at Utel.no>
    System Engineer
    UtelSystems a/s

    Nils Guest

  3. #3

    Default Re: Issues regarding the Native POSIX Thread library for Linux

    Nils O. Selåsdal wrote: 

    I think so. Is there a way I can check it out?
     

    That's what I understood from the specifications. Apparently, things
    seem to be much easier to do. My concerns involve application
    compatibility with the "previous" LinuxThreads implementation.

    For instance, are there any automatic 'configure' checks I can perform
    in order to choose which threads library to use? (I am talking about the
    LinuxThreads and the NTPL library)

    Thank you.

    Ciao,
    -Gabriele

    Gabriele Guest

  4. #4

    Default Re: Issues regarding the Native POSIX Thread library for Linux

    Gabriele Bartolini <prato.it> writes:
     
    >
    > I think so. Is there a way I can check it out?[/ref]

    getconf GNU_LIBPTHREAD_VERSION

    --
    Måns Rullgård
    se
    Måns Guest

  5. #5

    Default Re: Issues regarding the Native POSIX Thread library for Linux

    In article <btjk55$ad1$cs.interbusiness.it>, Gabriele Bartolini wrote: 
    >
    > I think so. Is there a way I can check it out?

    >
    > That's what I understood from the specifications. Apparently, things
    > seem to be much easier to do. My concerns involve application
    > compatibility with the "previous" LinuxThreads implementation.[/ref]
    It's compatible for some parts, incompatible for apps that take
    advantage of the diffrence between linuxthreads and pthreads.
    setting the env variable LD_ASSUME_KERNEL=2.2.5 should force
    and application to use linuxthreads iirc. 

    --
    Vennlig hilsen/Best Regards
    Nils Olav Selåsdal <NOS at Utel.no>
    System Engineer
    UtelSystems a/s

    Nils Guest

  6. #6

    Default Re: Issues regarding the Native POSIX Thread library for Linux

    In article <se>, Måns Rullgård wrote: 
    >>
    >> I think so. Is there a way I can check it out?[/ref]
    >
    > getconf GNU_LIBPTHREAD_VERSION[/ref]
    Seems usable. Any refrences to what parameters one can
    get with getconf ?
    Nils Guest

  7. #7

    Default Re: Issues regarding the Native POSIX Thread library for Linux

    Hi!
     
    > >
    > > getconf GNU_LIBPTHREAD_VERSION[/ref]
    > Seems usable. Any refrences to what parameters one can
    > get with getconf ?[/ref]

    I believe it is not (???).

    As you, Nils, pointed out correctly in thread #6 of this post, you
    might be using LT (when e.g. LD_ASSUME_KERNEL is set). A better (more
    dynamic so to say) way is to check which glibc is used with ldd:

    bash$ `ldd <your_binary> | grep libc | cut -f 3 -d' '`
    GNU CLibrary stable release version 2.3.2, by Roland McGrath et al.
    [...]
    Available extension:
    [...]
    NPTL 0.60 by Ulrich Drepper
    [...]

    If the OP is using LT instead, he should see the corresponding message
    for LT instead:

    linuxthreads-0.10 by Xavier Leroy

    Note that in both cases, getconf would return:

    bash$ getconf GNU_LIBPTHREAD_VERSION
    NPTL 0.60


    Regards,
    Loic.
    Loic Guest

  8. #8

    Default Re: Issues regarding the Native POSIX Thread library for Linux

    First, thanks Loic, Nils, and Mans!

    Loic Domaigne wrote:
     

    Thanks for your precious information about checking and setting the
    thread library.

    However, at a first glance I found NPTL extremely faster (I had a
    threaded application that used to run in 3 hours and now does the same
    in 1 hour!). Only threads and kernel versions changed.

    Ciao,
    -Gabriele

    Gabriele Guest

  9. #9

    Default Re: Issues regarding the Native POSIX Thread library for Linux

    Gabriele Bartolini <it> writes:
     

    That's one reason it was written.

    --
    Måns Rullgård
    se
    Måns Guest

Similar Threads

  1. unable to create new native thread
    By ke4pym in forum Coldfusion Server Administration
    Replies: 15
    Last Post: September 17th, 05:43 PM
  2. #39754 [NEW]: Some POSIX extension functions not thread safe
    By wharmby at uk dot ibm dot com in forum PHP Bugs
    Replies: 2
    Last Post: December 7th, 01:41 AM
  3. Replies: 2
    Last Post: March 11th, 11:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139