Re: Thread - what is the definition of it? (79 Views)
Reply
Frequent Advisor
Mott Given
Posts: 124
Registered: ‎01-30-2000
Message 1 of 5 (79 Views)
Accepted Solution

Thread - what is the definition of it?

I have an intuitive understanding of what a thread is, but I am looking for a formal definition of "thread" as HP-UX understands the term. I have found a lot of references in the HP docs related to how threads are used, but cannot find the definition of the word "thread" itself.

Mott Given
Please use plain text.
Acclaimed Contributor
A. Clay Stephenson
Posts: 17,825
Registered: ‎07-16-1998
Message 2 of 5 (79 Views)

Re: Thread - what is the definition of it?

Here is one definition supplied by HP (and it's a pretty good English description):

http://devrsrc1.external.hp.com/STKT/partner/threads.html

Here is an excerpt:


A thread (as defined by Maurice Bach's "The Design of the UNIX Operating System") is an independent flow of control within a process, composed of a context (including register set and a program counter) and a sequence of instructions to execute. The traditional flow of control within a program has been a process with a single context of registers, following a single path through the code. This is referred to as the "process-based" or "single-threaded model". For an application in a single-threaded model to handle multiple tasks, it would have to break those tasks up into multiple processes, coordinate with signal handlers to provide some concurrency, or simply deal with those tasks serially (one after the other).

A multi-threaded model for a process allows multiple concurrent paths of execution, or "threads", through the same process, allowing a single process to handle multiple tasks without having to program to serially move from one to the other. A multi-threaded process shares most of the process-related data, with only an additional kthread structure allocated for each of the multiple threads to give its register context, along with a private stack area and related resources. Access to multi-threading functionality is a tool a programmer can choose to use to improve the coding style or throughput of an application.

If it ain't broke, I can fix that.
Please use plain text.
Honored Contributor
Kent Ostby
Posts: 1,836
Registered: ‎09-26-2000
Message 3 of 5 (79 Views)

Re: Thread - what is the definition of it?

Still looking for the official definition.

Here is a link to a Prentice Hall book published by the Architects of the kernel thread stuff for HP:

http://www.prenhall.com/allbooks/ptr_0131900676.html

"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Please use plain text.
Valued Contributor
Jim Butler
Posts: 182
Registered: ‎04-17-2002
Message 4 of 5 (79 Views)

Re: Thread - what is the definition of it?

There are 2 types of threads

user threads and
kernel threads

To implement and create kernel threads, you must have access to the appropriate privilegdes. (/etc/privgroup) - man privgrp -

For User threads, you do not. There are some major differences between HP UX 11 and 10.20 when it comes to this issue, so use the references above (posted here above) and that will answer your question in more detail
Man The Bilge Pumps!
Please use plain text.
Honored Contributor
Hemanth Gurunath Basrur
Posts: 624
Registered: ‎03-28-2003
Message 5 of 5 (79 Views)

Re: Thread - what is the definition of it?

Hello Mott,

Refer to this document for more information.

http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/5965-4642/5965-4642_top.html&co...

HTH.

Happy New Year.

Regards,
Hemanth
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation