By default the many to many thread library is used on

This preview shows page 25 - 28 out of 33 pages.

By default, the many-to-many thread library is used on Solaris 8. Switching to the one-to-one library reduces the possibility of thread starvation and improves scalability. This improves the overall performance of the system. One-to-one is the default implementation in Solaris 9 and subsequent releases.
Image of page 25

Subscribe to view the full document.

26 4.4 Linux Threads A process, or task, in Linux is represented by a task_struct data structure. The task_struct data structure contains information in a number of categories: State: The execution state of the process (executing, ready, suspended, stopped, zombie). This is described subsequently. Scheduling information: Information needed by Linux to schedule processes. A process can be normal or real time and has a priority. Real-time processes are scheduled before normal processes, and within each category, relative priorities can be used. A counter keeps track of the amount of time a process is allowed to execute. Identifiers: Each process has a unique process identifier and also has user and group identifiers. A group identifier is used to assign resource access privileges to a group of processes. Inter-process communication: Linux supports the IPC mechanisms found in UNIX SVR4, described (shared memory based, message based) Links: Each process includes a link to its parent process, links to its siblings (processes with the same parent), and links to all of its children. Times and timers: Includes process creation time and the amount of processor time so far consumed by the process. A process may also have associated one or more interval timers. A process defines an interval timer by means of a system call; as a result, a signal is sent to the process when the timer expires. A timer may be single use or periodic. File system: Includes pointers to any files opened by this process, as well as pointers to the current and the root directories for this process. Address space: Defines the virtual address space assigned to this process. Processor-specific context: The registers and stack information that constitute the context of this process. Figure 4.9: Linux Thread Creation Unique solution: Does not recognize a distinction between threads and processes User-level threads are mapped into kernel-level processes These processes share the same group ID o To share resources and avoid the need o Avoid context switch when scheduler switches among processes in the same group A new thread is created a process is ―cloned‖ (rather than forked)
Image of page 26
27 o Some clone flags to define shared elements We have seen that modern versions of UNIX offer kernel-level threads. Linux provides a unique solution in that it does not recognize a distinction between threads and processes. Using a mechanism similar to the lightweight processes of Solaris, user-level threads are mapped into kernel-level processes. Multiple user-level threads that constitute a single user-level process are mapped into Linux kernel-level processes that share the same group ID. This enables these processes to share resources such as files and memory
Image of page 27

Subscribe to view the full document.

Image of page 28
You've reached the end of this preview.
  • Spring '12
  • GwangS.Jung

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern