COMP 3000 Essay 1 2010 Question 8: Difference between revisions

From Soma-notes
Rift (talk | contribs)
 
(64 intermediate revisions by 4 users not shown)
Line 1: Line 1:
=Question=
=QUESTION=


What is the history of POSIX Threads (pthreads)? Consider - does this history explain why UNIX was so late to implement support for multithreaded processes?
What is the history of POSIX Threads (pthreads)? Consider - does this history explain why UNIX was so late to implement support for multithreaded processes?


=Essay=
=ESSAY=


-[[User:Npatel1|Npatel1]] ; here is the final copy guys, feel free to edit the essay under "Unsorted". if it requires major changes please post a note in discussion board, cheers.


-Started throwing in some citation links. Some are duplicates because I'm not sure how to really do them correctly (kind of a wiki noob) -Afranco2
----


==INTRODUCTION==


'''POSIX threads, also known as Portable Operating System Interface, are high performance threads mainly distributed in UNIX but also to some Microsoft Windows OS. Threads are used in parallel programming; when a system call executes, the thread runs on an independent stream to finish its task with minimal interruptions or slowdowns. Pthreads are ideal for massive modifications to programs because the threads share one single memory space to alter a data structure, allowing constant high performance and efficiency. Pthread has become commonly used a way of adding concurrency to an application. They are widely used in UNIX; a powerful operating system written in the C language, which is continuously enhanced. Developers came across various obstacles with POSIX threads; during the beginnings of Pthreads, many technical issues had surfaced which were resolved throughout the history of POSIX threads.'''
'''POSIX threads, also known as Portable Operating System Interface, are high performance threads mainly distributed in UNIX but also to some Microsoft Windows OS. Threads are used in parallel programming; when a system call executes, the thread runs on an independent stream to finish its task with minimal interruptions or slowdowns. Pthreads are ideal for massive modifications to programs because the threads share one single memory space to alter a data structure, allowing constant high performance and efficiency. Pthread has become commonly used a way of adding concurrency to an application. They are widely used in UNIX; a powerful operating system written in the C language, which is continuously enhanced. Developers came across various obstacles with POSIX threads; during the beginnings of Pthreads, many technical issues had surfaced which were resolved throughout the history of POSIX threads.'''


==HISTORY==


'''The notion of threads developed naturally out of the desire for processes to communicate with each other. Threads are at a basic level multiple threads of control that share memory, and sharing memory is a relatively instantaneous method of communication.  In UNIX where processes were seen as needed on a 1:1 per-terminal basis, and more about time-sharing then working together, at first this seemed relatively unnecessary <ref> Sweet,David [http://tinf2.vub.ac.be/~dvermeir/manuals/KDE20Development-html/ch13lev1sec2.html "KDE 2.0 Development"]. Retrieved on October 14 2010</ref>. There were after all, mechanisms in place to communicate between processes such as pipes and temporary files as well as a few "just changed" messages. The first UNIX implementation of shared memory came about in 1983 with the System V UNIX flavor, which shared memory was merely one of several upgrades to passing messages between processes.[http://fscked.org/writings/SHM/shm-5.html]'''
====UNIX====
 


'''The beginning of POSIX Threads starts off with hardware sellers executing their own versions of threads[https://computing.llnl.gov/tutorials/pthreads/]. These developments varied from one another, creating difficulties for programmers to implement portable thread applications[https://computing.llnl.gov/tutorials/pthreads/].  With UNIX starting to develop shared memory as a viable Inter-process communication tool developers started to create a high demand for the ability to run multiple threads under one process. Consequently, IEEE began to form together the POSIX standards. In 1988, POSIX.1 - created to support application portability – was ratified and accepted as the international standard in 1990[http://www.opengroup.org/austin/papers/posix_faq.html][http://delivery.acm.org/10.1145/220000/210315/p11-walli.pdf?key1=210315&key2=0607607821&coll=GUIDE&dl=GUIDE&CFID=108396689&CFTOKEN=35895091]. After the approval, the POSIX standard grew to more than 20 individual standards, encapsulating a large area of different groups[http://delivery.acm.org/10.1145/220000/210315/p11-walli.pdf?key1=210315&key2=0607607821&coll=GUIDE&dl=GUIDE&CFID=108396689&CFTOKEN=35895091].'''


'''UNIX, the widely-known multi-user and multitasking computer operating system, was originally developed in 1969. The UNIX OS is trademarked is owned by The Open group and the specification is freely available on the worldwide web. The first official version of UNIX ran in 1970, on a PDP-11/20 machine; the first of the series called PDP-11 of compatible systems. This machine consisted of a text formatting program called 'ROFF' and a text editor. ROFF was the first UNIX text-formatting computer program;[http://cm.bell-labs.com/cm/cs/who/dmr/hist.html] it was rewritten in 1972, in a programming language called C which internally brought forth a number of portable software.  The standard C programming language became available to Universities, colleges, commercial firms, as well as the US Government. UNIX was progressing rapidly; many editions of UNIX were introduced by 1975, and versions 4.5 and 4.6 were distributed to the users.[http://www.levenez.com/unix/] Newer versions added the notion of ‘pipes’ which lead to numerous modular code-base and faster development cycle. Pipeline is essentially a chain of processes combined together by streams. As a result, the output of one process is the input of the following. UNIX became increasingly portable resulting in the release of Version 7 in 1979, followed by several more versions (8, 9, and 10) released in the 1980’s.'''


'''POSIX.1 lays out the interfaces for OS services; their syntax, and how they should act. However, it does not define how the interface should be implemented on the OS, allowing many different operating systems to conform to standards in their own specific design and application[http://delivery.acm.org/10.1145/220000/210315/p11-walli.pdf?key1=210315&key2=0607607821&coll=GUIDE&dl=GUIDE&CFID=108396689&CFTOKEN=35895091]. POSIX.2 was created for much of the same reason as POSIX.1; portable shell programming and portable program development, but describes a programmable shell and its common utilities[https://computing.llnl.gov/tutorials/pthreads/]. Although POSIX.2 improved on the original, POSIX threading has always been an issue on Linux. UNIX was so late to implement support for multithreaded process because it does not map that well onto Linux; this is due to the significant differences in relationship between POSIX and UNIX. These differences include: naming conventions (identifiers, operators, etc...), parameters and variables.[http://www.unix.org/whitepapers/shdiffs.html]'''


'''UNIX has progressed at an astounding pace in the past few years; early UNIX had a ‘process’ which was a thread of control with a virtual address space, and the interaction was through pipes due to the inability of sharing. After a while, the advancement of UNIX lead to processes that shared memory, introducing the invention of the thread. The threads are referred to as lightweight threads, in contrast to the heavyweight processes before it.'''


'''In the last twenty years, several advancements took place; there was a huge leap from the basic performance and function of a standard thread to a multi-threading, high performance POSIX thread. However, before it was given recognition as being efficient with high performance, a POSIX thread had numerous setbacks and high-priority challenges. Although the basic principle of a POSIX thread within UNIX was already executed by hardware sellers, it was under different names with minor structural variations, prohibiting developers to create portable thread applications. Fortunately, these issues were resolved and POSIX threads were enhanced, with continuous improvements on the way. Developers made an extraordinary breakthrough in concurrent programming by enabling efficiency and high performance, especially during immense modifications to data structure. Even with a rough past, POSIX threads have improved to become one of the most widely-known and commonly used method of adding concurrency to an application.'''
====THREADS/PTHREADS====


'''The notion of threads was developed naturally out of the desire for processes to communicate with each other. Threads are at a basic level of multiple threads of control that share memory, which is a relatively instantaneous method of communication. In UNIX, where processes were seen as a 1:1 per-terminal basis, and more about time-sharing than working together, at first this seemed relatively unnecessary [http://tinf2.vub.ac.be/~dvermeir/manuals/KDE20Development-html/ch13lev1sec2.html]. Retrieved on October 14 2010</ref>. They were after all, mechanisms in place to communicate between processes such as pipes and temporary files, as well as a few "just changed" messages. The first UNIX implementation of shared memory came about in 1983 with the System V UNIX flavour, which shared memory and was merely one of the several upgrades for passing messages between processes. [http://fscked.org/writings/SHM/shm-5.html]'''


----


=Unsorted=
'''The alternative Pthread implementation in the 4.0 Digital UNIX, also known as DEC OSF/1. Pthread library schedules’ threads consist of a one-to-one relationship; all threads fight other threads excluding the threads with the same process. This is good for priority, there is a positive correlation between priority and function; if priority rises, so does the function of the specific process. Many threads in a program have the ability to run on different CPUs, this prevents a program from being limited to a single executing thread. Native POSIX Thread Library is also known as NPTL which was first released in Red Hat Linux 9. This software enables the Linux kernel to run programs efficiently using POSIX threads.[http://java.sun.com/developer/technicalArticles/JavaTechandLinux/RedHat/] Version 1 of NPTL was released in 1996, followed by other versions leading up to version 2.6 recently. NPTL has become a part of the Linux kernel since version 2.6. To this day, threads in Linux are still created with the clone() system call in the Java programming language, although they are abstracted away in the actual language. Futexes are the newest evolution of mutexes in the Linux kernal and are the foundation of many mutual exclusion constructs that are frequently used in threaded programming. Despite the growing progress in Pthreads there have been many technical issues which lead to late implementation of support for multithread processes.[http://www.linuxjournal.com/article/6530] '''
(unsorted essay)


====COMPLICATIONS====


-[[User:Npatel1|Npatel1]] ; here is the first paragraph. you can edit/add more to the paragraph if needed!
'''The beginning of POSIX Threads starts off with hardware sellers executing their own versions of threads. These developments varied from one another, creating difficulties for programmers to implement portable thread applications[https://computing.llnl.gov/tutorials/pthreads/].  With UNIX starting to develop shared memory as a viable Inter-process communication tool developers started to create a high demand for the ability to run multiple threads under one process. Consequently, IEEE began to form together the POSIX standards. In 1988, POSIX.1 - created to support application portability – was ratified and accepted as the international standard in 1990[http://www.opengroup.org/austin/papers/posix_faq.html]. After the approval, the POSIX standard grew to more than 20 individual standards, encapsulating a large area of different groups.'''


-Afranco2; I put in the history section/strung in tmalone's stuff as well. Again, feel free to edit/add content


-Tmalone; Edited and corrected the information thus far. I will post a conclusion sometime tomorrow.
'''POSIX.1 lays out the interfaces for OS services; their syntax, and how they should act. However, it does not define how the interface should be implemented on the OS, allowing many different operating systems to conform to standards in their own specific design and application. POSIX.2 was created for much of the same reason as POSIX.1; portable shell programming and portable program development, but describes a programmable shell and its common utilities[https://computing.llnl.gov/tutorials/pthreads/]. Although POSIX.2 improved on the original, POSIX threading has always been an issue on Linux. UNIX was so late to implement support for multithreaded process because it does not map that well onto Linux; this is due to the significant differences in relationship between POSIX and UNIX. These differences include: naming conventions (identifiers, operators, etc...), parameters and variables.[http://www.unix.org/whitepapers/shdiffs.html]'''


-[[User:Npatel1|Npatel1]] ; Trevor, last lines should get us started on the conclusion. Afranco2; i went to class today and prof. was talking about plagiarism, can you please check your paragraph and see if there is any signs of plagiarism. since i don't know where you gathered your information from. upon you completion please post on wiki; need to make some modification to the body paragraph.
==CONCLUSION==


-http://delivery.acm.org/10.1145/220000/210315/p11-walli.pdf?key1=210315&key2=6626986821&coll=GUIDE&dl=GUIDE&CFID=108396689&CFTOKEN=35895091 That is one of the sources which I used for my information. I don't believe that I am plagiarizing, but I know that it is easy to do accidentally. If somebody wants to check it over for me to make sure, that would be great. My information comes from the first and second page. I also used POSIX Threads and the Linux Kernel and a little bit from IEEE POSIX Testing Policy General Information
'''In the last twenty years, several advancements took place; there was a huge leap from the basic performance and function of a standard thread to a multi-threading, high performance POSIX thread. However, before it was given recognition as being efficient with high performance, a POSIX thread had numerous setbacks and high-priority challenges. Although the basic principle of a POSIX thread within UNIX was already executed by hardware sellers, it was under different names with minor structural variations, prohibiting developers to create portable thread applications. Fortunately, these issues were resolved and POSIX threads were enhanced, with continuous improvements on the way. Developers made an extraordinary breakthrough in concurrent programming by enabling efficiency and high performance, especially during immense modifications to data structure. Even with a rough past, POSIX threads have improved to become one of the most widely-known and commonly used method of adding concurrency to an application.'''
 
 
-[[User:Npatel1|Npatel1]] ; oh i just wanted to make sure since the prof. emphasized on it a lot last class! thanks Afranco2.
 
 
 
POSIX (Portable Operating System Interface) threads, are high performance threads mainly distributed in UNIX but also to some Microsoft Windows OSes. Threads are used in parallel programming; when a system call executes, the thread runs on an independent stream to finish its task with minimal interruptions or slowdowns. Pthreads (from POSIX threads) are ideal for massive modifications to programs because the threads share one single memory space to alter a data structure, allowing constant high performance and efficiency. Pthreads have become a commonly used way of adding concurrency to an application. They are widely used in UNIX; a powerful operating system written in the C language, which is continuously enhanced. Developers came across various obstacles with POSIX threads; during the beginnings of Pthreads, many technical issues had surfaced which were resolved throughout the history of POSIX threads.
 
The history of POSIX Threads is that many hardware sellers executed their own versions of threads. These developments differed from one another, creating difficulties for programmers to implement portable thread applications. UNIX traditionally had a system running only a single thread under a process. These processes could not share memory and interacted using 'pipes'. Once developers started wanting to be able to run multiple threads under one process, IEEE began to form together the POSIX standards. In 1988 POSIX.1 (created to support application portability) was ratified and was accepted as the international standard in 1990. From there the POSIX standards grew to more than 20 individual standards, encapsulating a large area of different groups.
 
POSIX.1 lays out the interfaces for OS services; their syntax, and how they should act. It however does not define how the interface should be implemented on the OS. This is made to allow many different operating systems to conform to standards in their own specific design and application. POSIX.2 was created for much the same reason as POSIX.1 (portable shell programming, portable program development) but describes a programmable shell and its common utilities.
 
 
POSIX threading has always been an issue on Linux. UNIX was so late to implement support for multithreaded process because it does not map that well onto Linux; this is due to the significant differences in relationship between POSIX and UNIX.
 
^^^ this statement sounds a bit off.  why does UNIX care what Linux can handle? - John v.
 
 
I'll look into that tomorrow; working on 3005 Assignment. John, if you have a suggestion or an add-on that you wish to provide, please do so under collaboration.
 
-[[User:Npatel1|Npatel1]]
 
Hey guys, before end of tomorrow if there is anything missing or if anyone wishes to contribute more towards the essay please do so asap.
 
-[[User:Npatel1|Npatel1]]
 
UNIX cares about what Linux can handle because POSIX threads are mainly used in Linux systems. It is a very big deal if a  certain type of thread is generating countless errors on the main system type the thread is created for. And regardless of just the fact that its widely used on Linux, UNIX would care because compatibility is one of the most important things to have. For a POSIX thread to not be compatible with Linux just because UNIX didn't care, then the progress of multi-threading and POSIX threads would not be able to be used in Linux. Then Linux would not be as widely used as it would not be enhanced like other systems. It is important for systems to have that compatibility, so that they don't end up left in the dust of technology.
 
-[[User:Tmalone|Tmalone]]
 
----
 
One of the major reasons why UNIX was so late to implement support for the POSIX threads is the way the two define "multi-threaded" process.
Traditionally UNIX defined a process to be an instance of a running program.With POSIX this came to be defined more precisely. The 'process'
was defined to be "an address-space and a group of resources dedicated to running the program". <br>
POSIX defines a 'thread' as the resources neccessary for a single thread of execution ie. a single execution path. Thus according to POSIX the basic unit of execution is a thread. On the other hand UNIX traditionally defined a 'task' as the basic unit of execution which is essentially same as the POSIX definition of a 'process'.<br>
Now the conflict between the POSIX Threads and UNIX implementation of tasks came when a task used a clone() system call to create another task in order to implement multi-threading. The program then becomes a co-operating set of tasks which share 'some' resources. It is due to this halfway implementation of sharing of resources that lies the major conflict.<br>In a nutshell the fundamental difference between the two is that in POSIX a process can be addressed as a single entity, while in Linux it is a collection of independent tasks. In the POSIX thread implementation all actions affect the entire process. In Linux, however, each of these actions will only affect one task.
 
Not from your group. But I think your essay should incorporate this too. --[[User:Gautam|Gautam]] 19:35, 14 October 2010 (UTC)
 
=Collaboration=


Hey guys, i'm just gunna get this started by posting a few links for everyone to get going.  This will help explain a general idea of what they are and the history of them. Please add some more links or anything else you think would be helpful!
=SOURCES=


http://en.wikipedia.org/wiki/POSIX_Threads
[1] Dennis M. Ritchie, 1996. Bell Laboratoeries, The Evolution of the UNIX Time-Sharing System. online at: <http://cm.bell-labs.com/cm/cs/who/dmr/hist.html>
https://computing.llnl.gov/tutorials/pthreads/
http://sourceware.org/pthreads-win32/
-[[User:tmalone|tmalone]]


I found this, might not help, but it might:--[[User:Rannath|Rannath]] 02:09, 6 October 2010 (UTC)
[2] Éric Lévénez, September 2010. Unix History. online at: <http://www.levenez.com/unix/>


I'm not sure about the rest of you, but most of what I am able to find has to do with information on things that fall under POSIX, not actually about POSIX-afranco2
[3] David Sweet, 2001. Sams Publishing, KDE 2.0 Development. online at:<http://tinf2.vub.ac.be/~dvermeir/manuals/KDE20Development-html/ch13lev1sec2.html>


POSIX Threads, or pthreads, is a thread that is commonly used in UNIX systems but it also seen in some Microsoft Windows systems. A thread is a unit of process that executes segments of code within applications. When a process gets called from the system, the thread will execute the code for the process. POSIX stands for Portable Operating System Interface (for UNIX) and has been used by many independent sellers of hardware. There has always been issues such that developers could not create a reliable protable pthread application. For the use of multi-threading, its implementation arrived fairly late because the systems could not support it. Data mapping onto Linux gave birth to several problems due to the fact that POSIX and UNIX were implemented so differently.
[4] Mike Perry, September 1999. Shared Memory Under Linux. online at: <http://fscked.org/writings/SHM/shm-5.html>


-[[User:tmalone|tmalone]]
[5] Janice J. Heiss, 2003. Oracle. Red Hat Linux 9 and Java 2 Platform, Standard Edition 1.4.2: A Winning Combination. online at: <http://java.sun.com/developer/technicalArticles/JavaTechandLinux/RedHat/>


http://www.faqs.org/faqs/os-research/part1/section-10.html
[6] Robert Love, 2003. Introducing the 2.6 Kernel. online at: <http://www.linuxjournal.com/article/6530>


Might be of some use as well --[[User:Lmundt|Lmundt]] 14:48, 7 October 2010 (UTC)
[7] Blaise Barney, 2010. Lawrence Livermore National Laboratory. POSIX Threads Programming. online at: <https://computing.llnl.gov/tutorials/pthreads/>
https://computing.llnl.gov/tutorials/pthreads/


[8] Andrew Josey, February 2006, The Open Group. POSIX 1003.1 FAQ. online at: <http://www.opengroup.org/austin/papers/posix_faq.html>


Edited version from what -tmalone has written.
[9] Blaise Barney, 2010. Lawrence Livermore National Laboratory. POSIX Threads Programming. online at: <https://computing.llnl.gov/tutorials/pthreads/>


POSIX Threads is also called pthreads. Portable Operating System interface; mainly for Unix but it’s also distributed to some Microsoft Windows OS. A Thread is a unit of process that resides inside a process and executes when a system call has been executed. Threads have same global and all the threads share memory, threads also contain their personal private data. Pthread has become commonly used a way of adding concurrency to an application. The history of POSIX Threads is that many hardware sellers executed their own versions of threads. These developments differed from one another, creating difficulties for programmers to implement portable thread applications. POSIX threading has always been an issue on Linux. UNIX was so late to implement support for multithreaded process because it does not map that well onto linux; this is due to the significant differences in relationship between POSIX and UNIX.
[10] The Open Group, 1997 - 1999. What is UNIX?  online at: <http://www.unix.org/whitepapers/shdiffs.html>


-Npatel1
=Extra Links=


A bit different of a explanation of the history of threads in Unix:  
[1] Ross Johnson. POSIX Threads for Win32. online at: <http://sourceware.org/pthreads-win32/>


Originally in UNIX things similar to threads existed, they were however, called processes. The “processes” shared memory and used semaphores and thus “threads” have been around from the start. However, they disappeared when UNIX took the multics definition of process to mean they should not share memory, and all of sudden the ability to have threads disappeared. As people clamored to have the good old processes back, they created a new thing called “threads” that was actually what they had previously. So while it seemed they were late to support multithreaded processes, in reality they merely had a brief period where they didn’t have multi-threadedness.
[2] Dave McCracken, 2002. IBM Linux Technology Center. POSIX Threads and the Linux Kernel. online at: <http://www.kernel.org/doc/ols/2002/ols2002-pages-330-337.pdf>


-[[User:Rift|Rift]] 23:42, 10 October 2010 (UTC)
[3] L. Blunt Jackson, 2005. NPTL: The New Implementation of Threads for Linux. online at: <http://www.drdobbs.com/open-source/184406204>


Here is a possible simple conclusion I've typed up. I used the first chunk of Rifts paragraph then just threw in some extra info. Go easy on me lol
[4] Institute of Electrical and Electronics Engineers, Inc, 1998. IEEE POSIX Testing Policy - General Information. online at: <http://standards.ieee.org/regauth/posix/POSIX-A.FM5.pdf>


Originally in UNIX things similar to threads existed, they were however, called processes. The “processes” shared memory and used semaphores and thus “threads” have been around from the start. However, they disappeared when UNIX took the multics definition of process to mean they should not share memory, and all of sudden the ability to have threads disappeared. What are now considered POSIX threads have just been aliased for many years. The late implementation of these threads was because of the fact that so many developers had the basic principle of a POSIX thread in use, it was simply under a different name with minor structural differences. It is quite evident how POSIX threads came to be over the years especially within the UNIX system. From the basic performance and function of a standard thread to the multi-threading abilities of the POSIX thread, the development became more and more concrete. Though problems arose, such as creating portable thread applications between developers, solutions were found. POSIX.1 and POSIX.2 were created to display interfaces with specific syntax and to describe programming shells for many operating systems. Given the last 20 years when the leap was taken between a standard thread and a POSIX thread, and the speed in which the POSIX thread has been implemented, it can be said that given another 20 years the POSIX thread will have turned into something even more worth the wait.
[5] A Short History of UNIX, 2006. online at: <http://www.unix.com/unix-dummies-questions-answers/7-short-history-unix-l-madden-ic-ac-uk.html>


Okay guys this is a conclusion I've typed up. I have absolutely no idea if this is good enough, I find it pretty tough to write conclusions. Nonetheless, feel free to make changes and add/delete whatever you want. I'm not sure how formal he wants it to be, but I hope this is at least decent. If you want me to make some changes let me know what to change and I'll do it asap.
[6]Bradford Nichols, Dick Buttlar, and Jacqueline Proulx Farrell, O'Reilly & Associates, Inc, 1996. Pthreads Programming. online at: <http://books.google.ca/books?id=EZfElJsWCqgC&pg=PA198&lpg=PA198&dq=kernel+based+pthreads&source=bl&ots=3HFKw_0nqq&sig=P0L9feIb88xJRzQfLd7maKtVnTU&hl=en&ei=Oky3TM-_OaO0nAf1-YiwCA&sa=X&oi=book_result&ct=result&resnum=6&ved=0CCsQ6AEwBQ#v=onepage&q=kernel%20based%20pthreads&f=false>


(I constantly make changes myself :p)
[7]Bryan O'Sullivan, 1993 - 1996. The History of Threads. online at: <http://www.faqs.org/faqs/os-research/part1/section-10.html>


- Tmalone
[8]Lucent Technologies, 2002. The Famous PDP-7 Comes to the Rescue (And Continuous Pages). online at: <http://www.bell-labs.com/history/unix/pdp7.html>


==References==
[9]The Linux Information Project, 2004. Pipes: A Brief Introduction. online at: <http://www.linfo.org/pipe.html>
{{reflist}}

Latest revision as of 15:33, 8 November 2010

QUESTION

What is the history of POSIX Threads (pthreads)? Consider - does this history explain why UNIX was so late to implement support for multithreaded processes?

ESSAY

INTRODUCTION

POSIX threads, also known as Portable Operating System Interface, are high performance threads mainly distributed in UNIX but also to some Microsoft Windows OS. Threads are used in parallel programming; when a system call executes, the thread runs on an independent stream to finish its task with minimal interruptions or slowdowns. Pthreads are ideal for massive modifications to programs because the threads share one single memory space to alter a data structure, allowing constant high performance and efficiency. Pthread has become commonly used a way of adding concurrency to an application. They are widely used in UNIX; a powerful operating system written in the C language, which is continuously enhanced. Developers came across various obstacles with POSIX threads; during the beginnings of Pthreads, many technical issues had surfaced which were resolved throughout the history of POSIX threads.

HISTORY

UNIX

UNIX, the widely-known multi-user and multitasking computer operating system, was originally developed in 1969. The UNIX OS is trademarked is owned by The Open group and the specification is freely available on the worldwide web. The first official version of UNIX ran in 1970, on a PDP-11/20 machine; the first of the series called PDP-11 of compatible systems. This machine consisted of a text formatting program called 'ROFF' and a text editor. ROFF was the first UNIX text-formatting computer program;[1] it was rewritten in 1972, in a programming language called C which internally brought forth a number of portable software. The standard C programming language became available to Universities, colleges, commercial firms, as well as the US Government. UNIX was progressing rapidly; many editions of UNIX were introduced by 1975, and versions 4.5 and 4.6 were distributed to the users.[2] Newer versions added the notion of ‘pipes’ which lead to numerous modular code-base and faster development cycle. Pipeline is essentially a chain of processes combined together by streams. As a result, the output of one process is the input of the following. UNIX became increasingly portable resulting in the release of Version 7 in 1979, followed by several more versions (8, 9, and 10) released in the 1980’s.


UNIX has progressed at an astounding pace in the past few years; early UNIX had a ‘process’ which was a thread of control with a virtual address space, and the interaction was through pipes due to the inability of sharing. After a while, the advancement of UNIX lead to processes that shared memory, introducing the invention of the thread. The threads are referred to as lightweight threads, in contrast to the heavyweight processes before it.

THREADS/PTHREADS

The notion of threads was developed naturally out of the desire for processes to communicate with each other. Threads are at a basic level of multiple threads of control that share memory, which is a relatively instantaneous method of communication. In UNIX, where processes were seen as a 1:1 per-terminal basis, and more about time-sharing than working together, at first this seemed relatively unnecessary [3]. Retrieved on October 14 2010</ref>. They were after all, mechanisms in place to communicate between processes such as pipes and temporary files, as well as a few "just changed" messages. The first UNIX implementation of shared memory came about in 1983 with the System V UNIX flavour, which shared memory and was merely one of the several upgrades for passing messages between processes. [4]


The alternative Pthread implementation in the 4.0 Digital UNIX, also known as DEC OSF/1. Pthread library schedules’ threads consist of a one-to-one relationship; all threads fight other threads excluding the threads with the same process. This is good for priority, there is a positive correlation between priority and function; if priority rises, so does the function of the specific process. Many threads in a program have the ability to run on different CPUs, this prevents a program from being limited to a single executing thread. Native POSIX Thread Library is also known as NPTL which was first released in Red Hat Linux 9. This software enables the Linux kernel to run programs efficiently using POSIX threads.[5] Version 1 of NPTL was released in 1996, followed by other versions leading up to version 2.6 recently. NPTL has become a part of the Linux kernel since version 2.6. To this day, threads in Linux are still created with the clone() system call in the Java programming language, although they are abstracted away in the actual language. Futexes are the newest evolution of mutexes in the Linux kernal and are the foundation of many mutual exclusion constructs that are frequently used in threaded programming. Despite the growing progress in Pthreads there have been many technical issues which lead to late implementation of support for multithread processes.[6]

COMPLICATIONS

The beginning of POSIX Threads starts off with hardware sellers executing their own versions of threads. These developments varied from one another, creating difficulties for programmers to implement portable thread applications[7]. With UNIX starting to develop shared memory as a viable Inter-process communication tool developers started to create a high demand for the ability to run multiple threads under one process. Consequently, IEEE began to form together the POSIX standards. In 1988, POSIX.1 - created to support application portability – was ratified and accepted as the international standard in 1990[8]. After the approval, the POSIX standard grew to more than 20 individual standards, encapsulating a large area of different groups.


POSIX.1 lays out the interfaces for OS services; their syntax, and how they should act. However, it does not define how the interface should be implemented on the OS, allowing many different operating systems to conform to standards in their own specific design and application. POSIX.2 was created for much of the same reason as POSIX.1; portable shell programming and portable program development, but describes a programmable shell and its common utilities[9]. Although POSIX.2 improved on the original, POSIX threading has always been an issue on Linux. UNIX was so late to implement support for multithreaded process because it does not map that well onto Linux; this is due to the significant differences in relationship between POSIX and UNIX. These differences include: naming conventions (identifiers, operators, etc...), parameters and variables.[10]

CONCLUSION

In the last twenty years, several advancements took place; there was a huge leap from the basic performance and function of a standard thread to a multi-threading, high performance POSIX thread. However, before it was given recognition as being efficient with high performance, a POSIX thread had numerous setbacks and high-priority challenges. Although the basic principle of a POSIX thread within UNIX was already executed by hardware sellers, it was under different names with minor structural variations, prohibiting developers to create portable thread applications. Fortunately, these issues were resolved and POSIX threads were enhanced, with continuous improvements on the way. Developers made an extraordinary breakthrough in concurrent programming by enabling efficiency and high performance, especially during immense modifications to data structure. Even with a rough past, POSIX threads have improved to become one of the most widely-known and commonly used method of adding concurrency to an application.

SOURCES

[1] Dennis M. Ritchie, 1996. Bell Laboratoeries, The Evolution of the UNIX Time-Sharing System. online at: <http://cm.bell-labs.com/cm/cs/who/dmr/hist.html>

[2] Éric Lévénez, September 2010. Unix History. online at: <http://www.levenez.com/unix/>

[3] David Sweet, 2001. Sams Publishing, KDE 2.0 Development. online at:<http://tinf2.vub.ac.be/~dvermeir/manuals/KDE20Development-html/ch13lev1sec2.html>

[4] Mike Perry, September 1999. Shared Memory Under Linux. online at: <http://fscked.org/writings/SHM/shm-5.html>

[5] Janice J. Heiss, 2003. Oracle. Red Hat Linux 9 and Java 2 Platform, Standard Edition 1.4.2: A Winning Combination. online at: <http://java.sun.com/developer/technicalArticles/JavaTechandLinux/RedHat/>

[6] Robert Love, 2003. Introducing the 2.6 Kernel. online at: <http://www.linuxjournal.com/article/6530>

[7] Blaise Barney, 2010. Lawrence Livermore National Laboratory. POSIX Threads Programming. online at: <https://computing.llnl.gov/tutorials/pthreads/>

[8] Andrew Josey, February 2006, The Open Group. POSIX 1003.1 FAQ. online at: <http://www.opengroup.org/austin/papers/posix_faq.html>

[9] Blaise Barney, 2010. Lawrence Livermore National Laboratory. POSIX Threads Programming. online at: <https://computing.llnl.gov/tutorials/pthreads/>

[10] The Open Group, 1997 - 1999. What is UNIX? online at: <http://www.unix.org/whitepapers/shdiffs.html>

Extra Links

[1] Ross Johnson. POSIX Threads for Win32. online at: <http://sourceware.org/pthreads-win32/>

[2] Dave McCracken, 2002. IBM Linux Technology Center. POSIX Threads and the Linux Kernel. online at: <http://www.kernel.org/doc/ols/2002/ols2002-pages-330-337.pdf>

[3] L. Blunt Jackson, 2005. NPTL: The New Implementation of Threads for Linux. online at: <http://www.drdobbs.com/open-source/184406204>

[4] Institute of Electrical and Electronics Engineers, Inc, 1998. IEEE POSIX Testing Policy - General Information. online at: <http://standards.ieee.org/regauth/posix/POSIX-A.FM5.pdf>

[5] A Short History of UNIX, 2006. online at: <http://www.unix.com/unix-dummies-questions-answers/7-short-history-unix-l-madden-ic-ac-uk.html>

[6]Bradford Nichols, Dick Buttlar, and Jacqueline Proulx Farrell, O'Reilly & Associates, Inc, 1996. Pthreads Programming. online at: <http://books.google.ca/books?id=EZfElJsWCqgC&pg=PA198&lpg=PA198&dq=kernel+based+pthreads&source=bl&ots=3HFKw_0nqq&sig=P0L9feIb88xJRzQfLd7maKtVnTU&hl=en&ei=Oky3TM-_OaO0nAf1-YiwCA&sa=X&oi=book_result&ct=result&resnum=6&ved=0CCsQ6AEwBQ#v=onepage&q=kernel%20based%20pthreads&f=false>

[7]Bryan O'Sullivan, 1993 - 1996. The History of Threads. online at: <http://www.faqs.org/faqs/os-research/part1/section-10.html>

[8]Lucent Technologies, 2002. The Famous PDP-7 Comes to the Rescue (And Continuous Pages). online at: <http://www.bell-labs.com/history/unix/pdp7.html>

[9]The Linux Information Project, 2004. Pipes: A Brief Introduction. online at: <http://www.linfo.org/pipe.html>