- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have intel i3 processor on my laptop. though it has 2 cores it can run 4 threads at a time. When I see task manager I see programs with 11 threads , 40 threads. How are these threads scheduled? is it hardware implemented or managed by the host OS?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The operating system, when it has more software threads to run than hardware threads, will run a software thread until the earlier of: time quanta (few ms) or I/O that blocks. At that point it suspends the thread, then chooses a waiting software thread to run on that hardware thread.
A program can have more software threads than hardware threads (usually because they are waiting for something to do).
For compute bound applications it is usually counterproductive to use more software threads than hardware threads and optionally those that would otherwise be idle during run of application. Meaning should your system have two compute bound applications then better performance might be seen, say on your system 2C/4T, to have each app use 1C/2T. This would avoid adverse L1 and L2 cache interactions.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can also add to this explanation thread priorities which are used to prioritize execution and choose the higher priority thread to run before the lower priority thread.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page