-1

I was asked :

  • of examples of user-space-threaded systems and kernel-space-threaded systems.
  • whether Native POSIX Thread Library is considered part of user-space or kernel-space.
  • and if Java threading is done in user-space.

there's a huge amount of information about all these topics, but there doesn't seem to be a direct answer to those specific questions. I hope you could help me.

Aly Shmahell
  • 511
  • 2
  • 7
  • 18
  • I think someone is mixing terminology here. Please provide the source of these questions so that we can see what is actually being asked. – Stephen C Jun 28 '15 at 10:08
  • I thought as much, Unfortunately i can't provide the source. those are exact translations of questions provided as part of an Operating Systems curriculum written in Arabic. – Aly Shmahell Jun 28 '15 at 10:16
  • I edited the question to become more exact as a translation. I don't know if that changes the ambiguity of the question :) – Aly Shmahell Jun 28 '15 at 10:27

1 Answers1

3

I am using the terminology set out in this Wikipedia page

(I'll leave it to you to figure out if that terminology matches your Arabic course curriculum.)


Q1: Provide examples of user-space-threaded systems and kernel-space-threaded systems.

Modern Linux systems support kernel threads.

Old Linux and old Unix systems didn't support kernel threads, so if you needed threading you have to implemented it entirely in user space. The old Java "green threads" model was an example of threads implemented entirely in user space.

Q2: Is Native POSIX Thread Library is considered part of user-space or kernel-space.

The Native POSIX Thread Library (NPTL) is actually an API. It could be implemented in many ways.

Typical implementations (e.g. current Linux ones) use kernel threads; i.e. there is a 1:1 mapping between a "user-space" thread abstraction, and "kernel-space" threads or Light Weight Processes managed by the kernel.

Q3: Is Java threading is done in user-space.

Not in modern Java implementations. The first JVM implementations used user-space threads (aka green threads).


Note that there is debate over the true meaning of "user-space" and "kernel" thread, and how pthreads and NPTL fits into the taxonomy; see Is Pthread library actually a user thread solution?.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • 1
    Thank you, I really appreciate it. will be learning NPTL soon (on my own), it got my attention, and i sure will ask less ambiguous questions then ;) – Aly Shmahell Jun 28 '15 at 10:49
  • Native POSIX Thread Library is considered part of user-space. https://www.cse.iitd.ac.in/~rijurekha/col788/pthreads.pdf – dklovedoctor Jun 26 '21 at 09:22
  • You are confusing the terminology. From the page that I linked to: *"Threads are sometimes implemented in userspace libraries, thus called user threads. The kernel is unaware of them, so they are managed and scheduled in userspace. "*. This does not correspond to how the Native POSIX Thread Library works. With that, the kernel is aware of the threads, and the kernel does the thread scheduling. In reality the library you are taking about involves both kernel and user-space things. It is what the article describes as kernel threads. – Stephen C Jun 26 '21 at 09:29
  • So I looked at the slides you linked to, and they say that with NPTL there is a 1-1 mapping between "user-level threads" and "kernel-level threads". But it also calls NPTL a "userspace library". So ... I think this is a terminological disagreement between two sources. I am more inclined to trust Wikipedia than some random lecture notes. (And since I specifically cited Wikipedia as my source, I am going to let this stand.) – Stephen C Jun 26 '21 at 09:43
  • Finally, take a look at https://stackoverflow.com/questions/8639150 ... and you will see similar disagreements. – Stephen C Jun 26 '21 at 09:49