Szymon Lipiński
Szymon Lipiński

Reputation: 28634

Oracle Threads and Processes

Here: http://download.oracle.com/docs/html/A95907_01/diff_uni.htm#1077398 I found that on Windows Oracle is thread based, while on Unix this is process based. Why it is like that?

What's more, there are many Oracle processes http://www.adp-gmbh.ch/ora/concepts/processes/index.html regardless the system.

Why log writer and db writer are implemented as processes... and the query execution is done using threads (windows) or processes (unix).

Upvotes: 4

Views: 3269

Answers (2)

Gary Myers
Gary Myers

Reputation: 35401

Oracle makes use of a SGA shared memory area to store information that is (and has to be) accessible to all sessions/transactions. For example, when a row is locked, that lock is in memory (as an attribute of the row) and all the other transactions need to see it is locked.

In windows a thread cannot access another process's memory

threads cannot access memory that belongs to another process, which protects a process from being corrupted by another process.

As such, in Windows Oracle must be a single process with multiple threads. On OS's supporting the sharing of memory between processes then it is less work for Oracle to work as a multi-process architecture and leave the process management to the OS.

Oracle runs a number of background threads/processes to do work that is (or can be) asynchronous to the other processes. That way those can continue even when other processes/threads are blocked or busy.

Upvotes: 4

t0mm13b
t0mm13b

Reputation: 34592

See this answer I posted earlier on in similar vein to this question 'What is process and thread?'. Windows makes extensive use of threads in this fashion. Unlike *nix/Linux based systems which are based on threads. And see here also, this link is a direct link(which is embedded in the first link I have given) to the explanation I gave on how Linux time divisions threads and processes.

Hope this helps, Best regards, Tom.

Upvotes: 1

Related Questions