answersLogoWhite

0

If you are developing your application in user space, you can use POSIX threads implementation from glibc library.

bash# man pthread_create

You can also implement threads in kernel space using kthreads.

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Multiple threads with JavaScrip?

Workers or worker threads in ES5. Not implemented in IE <9.


What method must be implemented by all Threads?

The "run" method.


What java interface must be implemented by all threads?

Runnable interface


How threads are implemented in unix?

There are multiple ways to implement threads. An answer is beyond the scope of this site - I would refer you to the many textbooks on operating systems that explain this in detail.


What operation system has TCP IP built into it?

TCP/IP is not a specific program, but a specification. It has been implemented in different operating systems, like Windows, Linux, Cisco IOS, and others.TCP/IP is not a specific program, but a specification. It has been implemented in different operating systems, like Windows, Linux, Cisco IOS, and others.TCP/IP is not a specific program, but a specification. It has been implemented in different operating systems, like Windows, Linux, Cisco IOS, and others.TCP/IP is not a specific program, but a specification. It has been implemented in different operating systems, like Windows, Linux, Cisco IOS, and others.


What was the first 64-bit Linux platform for SAP application server and when was it first implemented?

ARMv8 on 2004


Is a router hardware?

Yes - it is usually implemented as a hardware device. There are router emulators, though, that run as a software, for example on Linux.


Is router hardware?

Yes - it is usually implemented as a hardware device. There are router emulators, though, that run as a software, for example on Linux.


Why thread is called light weight process?

Threads are implemented by a library that utilizes underlying kernel-supported threads of control, called light-weight processes (LWPs). http://java.icmc.usp.br/books/os/html/threads_lightweight_process.html


What is a .ko file in Linux?

The .ko extension is placed on kernel modules (loadable drivers) in Linux. Further, '.ko' extension is called 'kernel Object', and is implemented from kernel 2.6 onwards, this is perhaps the biggest change as far as loadable kernel modules are concerend. For example, the serial device driver that in Linux 2.4 lived in the file 'serial.o' in Linux 2.6 lives in the file 'serial.ko' .


Why is TCP faster in Linux than in Windows?

Pretty much everything is faster in Linux than in Windows. The Windows programmers need to prove to their bosses that they are doing the right thing, but the Linux programmers only need to prove to their peers that they are doing the right thing when they make improvements. Linux has things like zero-copy networking, which are not widely implemented in the Windows kernel(s).


When a user-level thread executes a system call not only is that thread blocked but also all the threads within the process are blocked Why is that so?

A system call is actually a transition from user mode to kernel space to carry out a required operation.. For exp: Write() function resides in kernel space and can be accessed by a only corresponding wrapper function which was implemented in user space.. In case of Windows OS, Win32 API is the implementation to such as wrapper functions that make the actual system calls from user mode.. A kernel thread is created, scheduled and destroyed by the kernel.. Whereas a library thread (user thread) is created, scheduled and destroyed by a user level library like special threading libraries.. The kernel does know of nothing about library threads since they live in a process's boundaries and bound to its life cycle tightly.. Actually, a process is not the primary execution unit in all operating systems.. When a process is made by kernel, a new kernel thread is created and attached to that process in question.. So the library threads created in user mode by a user mode library must share the time slices given to the kernel thread by the scheduler arbitrarily during the lifetime of a process.. So a process actually has one kernel thread and all other library threads have to share the kernel thread's cycles.. Hence when a library thread makes a blocking call, all the threads within the process are blocked because as I said, actually process has only one kernel thread assigned to it and others try to make use of it.. So to prevent other threads from blocking, either you should use library threads that make use of kernel threads or you could just use the CreateThread() Win32 API system function for kernel threads but the synchronization mechanism must be provided by the programmer using events, signals, mutex, semaphore etc.. Sun, BSD Unix flavours, Windows etc follow the same threading architecture in their systems as POSIX standard.. However, a thread is a process in Linux.. That's why Linux is so powerful in server systems.. So the control is left to programmers to create a POSIX way of treading model by Clone(2) system call(s).. So address space and data etc can be shared by lightweight processes easily.. When a Linux kernel thread (child process) is crashed, it won't affect the rest of the threads belong to parent process.. This is just the opposite in other operating systems that a crashing thread will destroy all of the threads in the process.. NPTL is a great threading library that was implemented by using Linux clone(2) system call.. Linux also has another type of kernel thread only lives in kernel space that can be utilized by kernel code like modules.. User threads can't be run in parallel on the different CPUs because of this. However, they are portable.. Kernel threads can be scheduled by kernel to be run on a SMP system.. Hope this helps.. hsaq19@ TH Algan