Db2 – Differences between EDU and thread


In DB2, there is this command that shows active EDUs (engine dispatchable units):

db2pd  -edus

There are two fields in the respective output: EDU ID and TID.

According to this db2pd page from the DB2 knowledge center, each is defined as follows:

EDU ID: The unique identifier for the engine dispatchable unit (EDU). Except on Linux operating systems, the EDU ID is mapped to the thread ID. On Linux operating system the EDU ID is a DB2 generated unique identifier

TID: Thread identifier. Except on Linux operating systems, the thread ID is the unique identifier for the specific thread. On Linux operating systems, this is a DB2 generated unique identifier

I wanted to know what is considered EDU or thread on a Linux/Unix operating system? Are they the same? What is the difference?

Best Answer

EDU is an abstraction over the underlying OS scheduling unit, a sort of a surrogate key assigned to whatever is doing actual work in the OS. If the OS has true threads, distinct from processes, such as Windows, an EDU will map to a thread. On modern Linux, which doesn't have threads but rather lightweight processes (LWPs), an EDU would map to one of such LWPs and the thread ID value would be artificial.

On some operating systems there is an extra level of abstraction in the form of separately managed user and kernel threads; in such cases an EDU will be mapped to a distinct kernel thread ID (KTID) in addition to the user TID.