Importance of AIXTHREAD_SCOPE in Oracle

Lets start with basics

A process can spawn multiple threads with each  thread executing performing different task concurrently. The advantages with threads is that they require less system resources and start  easily when compared to processes.

Generally a process can run  in 2 modes

  1.   Kernel mode or  system mode
  2.  User mode:

Kernel mode : There is a 1-1 relationship between kernel and thread. Execution of process in kernel mode  provides the thread with  complete and unrestricted access to the underlying hardware.  Thereby improving the performance of the  process.

User mode: There is no dedicated kernel process and many to many relation ship exist between kernel and  thread.  The user mode is less expensive and support less concurrency compare to kernel mode.  Scheduling is done by user scheduler

AIXTHREAD_SCOPE

On  AIX the variable AIXTHREAD_SCOPE specifies if Oracle processes will run in kernel mode or user mode. That is whether a thread has  process wide contention(P)  or system wide contention(S). The default is P or process wide contention.

Process wide Scope
When Oracle starts a thread with  process wide scope, the following occurs:

1. No dedicated kernel thread, Many to Many relation ship exist between kernel and thread.
2. Placed in  run queue for CPU intensive system
3. Subjected  to  time slicing by the user scheduler.

System Wide Scope
When Oracle starts a thread with system wide scope,  the thread is bound to the kernel and scheduled by the kernel.  There is a 1-1 relationship between kernel and thread. In other words, the kernel thread is not shared with any other user thread.  As you are aware , execution of process in kernel mode  provides the thread with  complete and unrestricted access to the underlying hardware.  Therefore improving the performance of the  process.

Oracle recommends system wide scope.

References : IBM Documenation , Oracle Metalink

Tagged: , ,

Leave a comment