Обложка книги «Programming with POSIX® Threads»

Programming with POSIX® Threads

David Butenhof

Читать онлайн

Скачать

Начало книги

In a dictionary, you would probably see that one of several definitions for "thread" is along the lines of the third definition in the American Heritage paperback dictionary on my desk: "Anything suggestive of the continuousness and sequence of thread." In computer terms, a thread is the set of properties that suggest "continuousness and sequence" within the machine. A thread comprises the machine state necessary to execute a sequence of machine instructions—the location of the current instruction, the machine's address and data registers, and so forth.

A UNIX process can be thought of as a thread, plus an address space, file descriptors, and an assortment of other data. Some versions of UNIX support "lightweight" or "variable weight" processes that allow you to strip some or all of that data from some of your processes for efficiency. Now, whether you're using a "thread" or a "lightweight process," you still need the address space, file descriptors, and everything else. So, you might ask, what's the point? The point is that you can have many threads sharing an address space, doing different things. On a multiprocessor, the threads in a process can be doing different things simultaneously.

Читать дальше →

Жанр
Программирование, программы, базы данных
Год написания
1997
Издание
Addison-Wesley Professional, 1997
ISBN
ISBN 978-0201633924
Язык
en
Размер FB2
1,5 МБ
Добавлена