General discussion

Locked

what is preemptive multithreading ?

By ameet.joshi ·
what is pre emptive multithreading exactly ? Does Linux support that ? what are the advantages of it ?

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

what is preemptive multithreading ?

by compaqer In reply to what is preemptive multit ...

MULTITHREADING is when a piece of code can execute with multiple contexts simultaneously. These threads can be scheduled by the CPU. This can occur at the OS level or at the application level. It can implement parallel processing when the system contains multiple CPU's.

PREEMPTIVE MULTITHREADING means that the execution of a thread can be "preempted", i.e. interrupted, by another thread. This is useful for event driven situations, like
handling disk drives, network packets, etc.

Linux supports preemption, and it supports multithreading, but sources indicate it does not provide true "preemptive multithreading", but rather emulates it.

http://www.nswc.navy.mil/cosip/may99/sugg0599-1.shtml says:

Linux: Linux is a general-purpose, preemptive, multi-threaded implementation of SVR4 UNIX, BSD UNIX, and POSIX. It supports POSIX real-time process and thread scheduling. The thread implementation utilizes processes created by a special clone version of fork. This design simplifies the Linux kernel

Collapse -

what is preemptive multithreading ?

by ameet.joshi In reply to what is preemptive multit ...

The question was auto-closed by TechRepublic

Collapse -

what is preemptive multithreading ?

by compaqer In reply to what is preemptive multit ...

though it limits scalability because kernel process resources are used for each application thread.

http://www.bens-site.co.uk/College/Operating%20Systems.htm says:

Multithreading: [Linux] has native kernel support for multiple independent threads of control within a single process memory space.

http://www.accessone.com/~jql/clone-faq.html says:

while the clone() sys-call itself is much slower than it's user-space counter-part, the overhead in emulating preemptive multithreading by using non-blocking sys-calls slows down every other part of pthreads.

Collapse -

what is preemptive multithreading ?

by ameet.joshi In reply to what is preemptive multit ...

The question was auto-closed by TechRepublic

Collapse -

what is preemptive multithreading ?

by compaqer In reply to what is preemptive multit ...

However, for the other point of view, see
http://linuxtoday.com/stories/3830_flat.html

It says that .....

"Linux-2.2.x most certainly supports in kernel reentrant threads using LinuxThreads and the clone() system call. This is _not_ a cooperative userspace threading model like pthreads, but fully preemptive in kernel threading with hooks in glibc for userspace threads. So your claim that a thread could call a kernel function which could then block the thread execution in an I/O wait is completely bogus under 2.2.x, but correct for 2.0.x. "

It appears to me that the question of whether Linux does preemptive multithreading has become more of a religious question than a technical question.

Collapse -

what is preemptive multithreading ?

by ameet.joshi In reply to what is preemptive multit ...

The question was auto-closed by TechRepublic

Collapse -

what is preemptive multithreading ?

by ameet.joshi In reply to what is preemptive multit ...

This question was auto closed due to inactivity

Back to Linux Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums