COMP 3000 Essay 1 2010 Question 8

From Soma-notes
Revision as of 00:56, 15 October 2010 by Npatel1 (talk | contribs) (→‎UNIX)

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

-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

-Npatel1 ; working on UNIX, Treads/Pthreads. (adding the answers to addition questions) will be done around 12-1AM.


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

(not done yet! Cite it after 12AM, still making major changes)

The UNIX process model was introduced in the early 1970’s, Began on a PDP-11/20; PDP-11/20 was the first of the series called PDP-11 of compatible systems. This machine consisted of Text formatting program referred as “ROFF” and text editor. ROFF was the first UNIX text-formatting computer program; it was rewritten in Programming language called C in 1972 which internally brought forth number of portable software. Standard C programming language became available to Universities/Colleges and commercial firms as well as the US Government. UNIX was progressing rapidly; Many edition of UNIX were introduced by 1975, Versions 4,5, and 6 were distributed to the Users. 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 together by streams, thus that the output of one process is the input of the following . Unix became more and more portable and Version 7 was released in 1979, several more versions (8, 9, and 10) were also released in the 1980’s.

Unix has progressed at an astounding pace in the past few years; Early UNIX had a ‘process’, which was essentially a thread of control with a virtual address space; since they were unable to share, interaction was through pipes. After a while the advancement of UNIX lead to processes that shared memory, bringing the invention of the thread. The threads are referred as lightweight threads in contrast to the heavyweight processes before it...

Threads/Pthreads

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[1]. 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.[2]

Complications

The beginning of POSIX Threads starts off with hardware sellers executing their own versions of threads[3]. These developments varied from one another, creating difficulties for programmers to implement portable thread applications[4]. 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[5][6]. After the approval, the POSIX standard grew to more than 20 individual standards, encapsulating a large area of different groups[7].


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[8]. 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] The Open Group, 1997 - 1999. What is UNIX? online at: <http://www.unix.org/whitepapers/shdiffs.html>

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

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

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

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

[6] 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>

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

[8] 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>

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

[10] 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>

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

[13] 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/>

[14] 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>

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