This does not mean that extensions beyond the posix

This preview shows page 4 - 6 out of 16 pages.

achieve source code compatibility with other platforms. This does not mean that extensions beyond the POSIX specification are not added. Effective Use Of SMP One of the main goals of using threads is to provide means to use the capabilities of multi-processor systems. Splitting the work in as many parts as there are CPUs can ideally provide linear speedups. Low Startup Cost Creating new threads should have very low costs associated to be able to create threads even for small pieces of work. Low Link-In Cost Programs which are linked with the thread library (directly or in- directly) but don’t use threads should not be affected much by this. Binary compatibility The new library should be binary compatible with the Linux- Threads implementation. Some semantic differences are unavoidable: since the LinuxThreads implementation is not POSIX compliance these areas necessarily change. Hardware Scalability The thread implementation should run sufficiently well on large numbers of processors. The administrative costs with increasing numbers of pro- cessors should not rise much. Software Scalability Another use of threads is to solve sub-problems of the user ap- plication in separate execution contexts. In Java environments threads are used to implement the programming environment due to missing asynchronous oper- ations. The result is the same: enormous amounts of threads can be created. The new implementation should ideally have no fixed limits on the number of threads or any other object. Machine Architecture Support Designs for big machines have always been a bit more complicated than that for consumer and mainstream machines. Efficient support for these machines requires the kernel and user-level code close to the OS to know details about the machine’s architecture. Processors in big machines for instance are often divided in separate nodes and using resources on other nodes is more expensive. 4
Image of page 4

Subscribe to view the full document.

Draft NUMA Support One special class of future machines of interest are based on non- uniform memory architectures (NUMA). Code like the thread library should be designed with this in mind to not defeat the benefits of the architecture when using threads on such machines. The design of data structures is important. Integration With C++ C++ defines exception handling which deals automatically with the cleanup of objects in the scopes which are left when throwing an exception. Cancellation of a thread is similar to this and it is reasonable to expect that can- cellation also calls the necessary object destructors. 5 Design Decisions Before starting the implementation a number of basic decisions have to be made. They affect the implementation fundamentally. 5.1 1-on-1 vs. M-on-N The most basic design decision which has to be made is what relationship there should be between the kernel threads and the user-level threads. It need not be mentioned that kernel threads are used; a pure user-level implementation could not take advantage of multi-processor machines which was one of the goals listed previously. One valid
Image of page 5
Image of page 6
You've reached the end of this preview.
  • Spring '12
  • GwangS.Jung
  • Native POSIX Thread Library, POSIX

{[ 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