Skip to content

Types of Concurrency

20080423 (2008 April 23 Wednesday)
Non Protected Protected
Synchronous Single Task Simple N/A
One task at a time Batch processing.
Round Robin Run to completion Batch processing that runs many times, Can’t do tasks that run for a long time. Excellent for event processing.
Cooperative Tasks run continually, Hand over to other task when ready. When they get another turn, they continue from where they left off.
Asynchronous Fixed hard priority Highest priority task runs.
Preemptive Not suitable for mission critical applications, unless great care is taken, and appropriate patterns used.

Use for general purpose computer. Needs special hardware or language support.

Examples

  1. Preemptive-protected: Process in NT/XP/Win2000/UNIX/Linux/Hurd/Posix/Bsd/QNX/MacOs X
  2. Preemptive-unprotected: Task in Amigados/uCos/win95-me, Thread in
    NT/XP/Win2000/UNIX/Linux/Hurd/Posix/Bsd/QNX/MacOs X/Java/Rhapsody
  3. Cooperative: Task in MacOs 9 and below, some embedded systems,
    co-routines in some programming language, NT fibers, UNIX/Linux/Hurd/Posix/Bsd/QNX nanothreads.
  4. Round-Robin: Event loop in most GUI/windows programs, Rhapsody
    OXF, some embedded systems.
  5. Run Once: Batch processors.
  6. Single Task: MSDos, Everything is really a single task, everything else is an elusion.

Note: A lot of terms have different meanings in different
contexts, especially “task”.

Note: A thread is sometimes called a light weight task.

Note: a nanothread and fiber are the same thing.

Priorities

  1. Hard: The highest priority task will run. (see also priority inheritance, to help avoid priority inversion.
  2. Soft:Priority indicates the amount of resources to give the task. Unix and linux derived OSs call this niceness (niceness is priority times -1). They also have dynamic priority such that to tasks at the same priority can have there dynamic priority changed, a task that hogs the processor will have its priority reduced, and one that spends its time waiting will have its priority raised. This improves responsiveness, to events, and stop badly behaved tasks slowing everything down.

Note: I Have only included publicly available OS’s that I know about.

See also: other concurrency articles.

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: