Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Windows Linux
Hi All,
Iam doing a term project to measure the performance of multithreading in windows and linux.
Iam confused between user threads and kernel threads.I have read, in an article thread creation, thread termination and thread scheduling is handled by OS in ubuntu Linux and in windows 7.
when Iam calling pthread_create() function, is OS(Linux) creating thread or the posix library?
OS(linux) can create user threads and kernel threads?
 
Windows, Iam using WIN32 threads, Is WIN32 is API or an library?
same confusion as in linux.
 
Can any one suggest me any material with clarity on these things.
Posted 17-Nov-12 14:18pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

API == Application Programming Interface
You seem to be quite on the confused side... An API is a public interface to a library. The winapi is a public interface to the win32 libraries. The STD C header set is a public interface (API) to the std c libraries, and so on... Every program is a bunch of code that uses libraries. You can treat an operating system as a set of libraries - each library having its own interface (API).
 
The most effective way of thread synchronization is always using the most suitable thread synchronization primitives offered natively by the OS. Note that one feature found in one OS might not be present in another OS. For this reason using a cross-platform library (like pthreads) might not give you meaningful results. For example simulating a condition variable+mutex (present in pthread api) has been painful in Win32.
The optimal solution to a multit-hreading problem can be completely different on 2 different OSes.
 
From this point you should continue your research by yourself using google. While googling don't forget that you are probably not the first to create benchmarks for this purpose. I would also note that creating such a benchmark requires experience with threading on each platform because you have to know the strength and weakness of each synchronization primitive (and scheduling problems) quite well and have to have a guess on good solutions to certain multi-threading problems - its not a game for a beginner in threading.
  Permalink  
Comments
CPallini at 18-Nov-12 16:42pm
   
5.
pasztorpisti at 18-Nov-12 17:37pm
   
Thank you!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web01 | 2.8.1411022.1 | Last Updated 18 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100