57 Thread ID compatibility issue With M N thread model compatibility issue

57 thread id compatibility issue with m n thread

This preview shows page 6 - 9 out of 9 pages.

5.7 Thread ID compatibility issue With M: N thread model compatibility issue arises with other POSIX thread implementations because of each thread having a different process ID. This is really a debatable point since signals can't be used well. But using 1:1 model solves many per- romance and functionality issues by assigning single process ID to all threads. Now it is easy to guess that performance can be achieved if there are same numbers of user and kernel level threads [2] [6] [8]. 6 Performance Evaluation We have tested the performance evaluation parameters on the given pseudo code by using Ubuntu 12.04 and kernel version 3.10 in POSIX thread library. These parameters are Single Process ID, CPU Affinity, Number of kernel threads and True pearl- leis [2][16][17]. Here results show that 1:1 Model is much better in terms of performance as compared to M: N Model Table 3. Performance evaluation
Image of page 6
Pseudocode Tested for performance under POSIX for LINUX using 1:1 Threading Model Begin Enter choice for calculator If choice == 1 pthread_attr_init (&attar) pthread_create(&tide,&attr, add,choice) pthread_join (tid, NULL) Else if choice == 2 pthread_create(&tid,&attr,s ub,choice Else if choice == 3 pthread_create(&tid,&attr, mul,choice) print result Else if choice == 4 pthread_create(&tid,&attr,d iv,choice) Else Print choice is invalid End
Image of page 7
Simplicity Kernel routines can be multi threaded. True Parallelism Inter-Thread synchronization Thread Creation is less costly Signal handling in kernel CPU Affinity cab be set by assigning different thread different CPUs. Single Process ID solves many problems of per- formance and functionality. Compatible with latest POSIX and other plat- forms. Efficient Use of SMP Points to prefer 1:1 thread model Table 4 below is summarizing important and distinct benefits of implementing 1:1 multithreading model. Table 4. Important Points for Justifying 1:1 Thread Model Table 5 . Performance Evaluation Table for Code in Table 3. 7 Conclusion and Future Work This paper focuses the multithreading models in detail. Key factors of both models have been analyzed we have given rea- sons why Solaris and Linux shifted to 1:1 implementation and retired the historical M: N thread model. Solaris and Linux have many reasons of this semantics mainly discussed in this paper are scheduler activation, signal hand- ding, number of threads, CPU, Affinity settings, inter-thread synchronization, Single Process ID, scalability and performance improvement without recompilation. 1:1 thread model is proven best in later versions of Solaris and Linux as there is no per- romance penalty. In future more work can be done to simulate the idea with some implementation in a controlled environment. For this per- pose Linux thread API and JAVA threads could be used. Further it can be worked out how 1:1 Model data structures impact on multicore processor’s performance. References View publication stats Results for Selected parameters No of Proce sses No. of Threads No. of Kernel Process ID CPU Affinity 01 04 (02) threads per core 04 for each thread 4516
Image of page 8
Image of page 9

You've reached the end of your free preview.

Want to read all 9 pages?

  • Fall '16
  • Sir Adnan
  • Context switch, Native POSIX Thread Library

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

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors