Logo Background

Multithreading

  • I would like to clarify some conceptual doubts that I have regarding multithreading. It would be appreciated if you could refer me to a multithreading tutorial, and a University level book that deals with the subject. It is important that either (or both) show programming examples, otherwise my doubts will most likely remain!

    I have the utmost respect for you if you want to learn about the theoretical foundations of multithreading, as this is a very complex subject. For those readers who do not understand multithreading, it essentially allows a program (or operating system) to execute multiple requests without the need to open a new copy of the program for each request. Each request is a separate ‘thread’, and the program or operating system manages the progress of each thread to ensure each thread is executed to completion. A simple example of this concept is a web server. When a web page request comes into a web server, a thread is started to respond with the requested web page. Since multiple requests may come in while other requests are being processed (since many users may be using the website at one time) the web server must be able to process these different threads simultaneously. So, the web server is multithreaded. If the web server was not multithreaded, it could only satisfy one web page request at a time, so while one request is being satisfied, no others could be accepted. This would make it almost impossible to use the website, since you would need to keep sending your request until you were lucky enough to get it through when no others requests were being processed!

    For a more detailed explanation of multithreading, check out the Wikipedia articles on threads (en.wikipedia.org/wiki/Multithreading), which also contains a Java program example and Simultaneous multithreading (en.wikipedia.org/wiki/Simultaneous_multithreading). As for a University level text book, have a look at ‘Principles of Concurrent and Distributed Programming: Algorithms and Models’ (2005) by M. Ben-Ari. This is the textbook for a computer science course at the Australian National University, so the book should be available from the ANU Co-op Bookshop. However, before purchasing I suggest you have a browse and check if any other books are more relevant to your needs. Going to a University book store is your best bet, since they should have books covering such topics. These books are likely to also contain good tutorials and exercises on multithreading.

Leave a Comment
Hi there. If this is the first time you are posting a comment it will not appear immediately, but needs to be approved. This is necessary in order to combat comment spam. However, once you have submitted a comment (which is subsequently approved) you do not need to go through this process again - the site remembers who you are and auto-approves your comments. Nifty eh? Anyway, sorry about the inconvenience that this may cause for your first comment post.