• Re: [OT] PIDs for Linux threads (was Re: pid ranges)

    From Kenny McCormack@21:1/5 to janis_papanagnou+ng@hotmail.com on Mon Oct 7 16:41:49 2024
    In article <ve128d$1pf02$1@dont-email.me>,
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
    [ This is getting off-topic, sorry. ]

    On 07.10.2024 15:31, Richard Kettlewell wrote:

    _On Linux_ process IDs and thread IDs share the same number space which
    changes the picture quite a bit: [...]

    This is interesting.
    Since processes are handled by the OS kernel what does that imply...?
    A common process/thread interface in Linux?
    Is that defined by POSIX threads, or is it something specific?

    Is there any good link to read more about that?

    "man clone" is a good starting place.

    In Linux, threads are almost the same thing as processes. Obviously, there
    are differences, but basically, that is true. Both are created via clone(2). (fork() is implemented on top of clone()).

    --
    No, I haven't, that's why I'm asking questions. If you won't help me,
    why don't you just go find your lost manhood elsewhere.

    CLC in a nutshell.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lew Pitcher@21:1/5 to Janis Papanagnou on Mon Oct 7 16:47:26 2024
    On Mon, 07 Oct 2024 18:29:00 +0200, Janis Papanagnou wrote:

    [ This is getting off-topic, sorry. ]

    On 07.10.2024 15:31, Richard Kettlewell wrote:

    _On Linux_ process IDs and thread IDs share the same number space which
    changes the picture quite a bit: [...]

    This is interesting.
    Since processes are handled by the OS kernel what does that imply...?
    A common process/thread interface in Linux?

    Exactly.
    In the early 2000's, the Linux kernel moved to supporting 1:1 threads,
    and provided the NPTL ("Native Posix Threading Library") to provide the
    POSIX application-level API to this new kernel capability.

    Is that defined by POSIX threads, or is it something specific?

    It is how Linux implements the kernel-level responsibilities of POSIX
    threads.

    Is there any good link to read more about that?

    Plenty. Google "NPTL and Linux"

    (My thread times have long passed; I used it from C++, and there were
    a lot of things to consider when programming with threads back then.)

    Janis




    --
    Lew Pitcher
    "In Skills We Trust"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Richard Kettlewell on Mon Oct 7 18:29:00 2024
    [ This is getting off-topic, sorry. ]

    On 07.10.2024 15:31, Richard Kettlewell wrote:

    _On Linux_ process IDs and thread IDs share the same number space which changes the picture quite a bit: [...]

    This is interesting.
    Since processes are handled by the OS kernel what does that imply...?
    A common process/thread interface in Linux?
    Is that defined by POSIX threads, or is it something specific?

    Is there any good link to read more about that?

    (My thread times have long passed; I used it from C++, and there were
    a lot of things to consider when programming with threads back then.)

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)