flat assembler
Message board for the users of flat assembler.

Index > OS Construction > how does OS implement multithreading?

Author
Thread Post new topic Reply to topic
m



Joined: 28 Dec 2006
Posts: 304
Location: in
m
hi all,
i was looking for some online book etc. which will describe the techniques used by modern OSs to implement multi-threading... how do they manage so many threads contained in a single process?

hope that someone knows about a really good online source of such info..

_________________
Attitude!
Post 08 Jul 2008, 11:44
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
There's several thing included. One is the "thread context", which at the very least includes a copy of the CPU registers - but typically also a lot more than that (OS dependent stuff). Threads also usually have separate stacks.

To schedule threads for execution, you typically use a timer interrupt which does some bookkeeping and decides when to switch from one thread to another - there's various different algorithms you can use for this.

Yes, that was pretty incomplete and generic - I suggest you to find a copy of "Inside Windows"/"Windows Internals", there's some decent description of how NT handles it.
Post 08 Jul 2008, 14:24
View user's profile Send private message Visit poster's website Reply with quote
tom tobias



Joined: 09 Sep 2003
Posts: 1320
Location: usa
tom tobias
m wrote:

how do they manage so many threads contained in a single process?
unix type environment
another unix environment.
http://technet.microsoft.com/en-us/library/bb497012(TechNet.10).aspx
here's a power point presentation.
Post 08 Jul 2008, 14:56
View user's profile Send private message Reply with quote
m



Joined: 28 Dec 2006
Posts: 304
Location: in
m
thanks tom for those links! exactly what i needed.
thanks a lot, although i can't thank you enough Smile

_________________
Attitude!
Post 09 Jul 2008, 11:56
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
Quote:

how will edfed implement the multithreading?


very hard thing to do, but possible.

threads have execution contexts.
they are not tasks.
no TSS.
ESI for current, EDI for parent, and ESP for returns and temporary values.

follow the fool principle, it will be exactlly like that.

it is still ok, but cannot be called multithread because the system doesn't interrupt them to dispatch the work.

Very Happy
Post 09 Jul 2008, 16:45
View user's profile Send private message Visit poster's website Reply with quote
myothant



Joined: 31 Oct 2008
Posts: 2
Location: in yangon
myothant
How to make simple Operating System
Post 31 Oct 2008, 09:35
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
myothant wrote:
How to make simple Operating System


Please don't pollute threads, multithreading is not what you have to care about now, OS construction is the correct subforum, first look into some "bootsector" , "bootable Hello World" , "MiniDOS" or similar examples, and then open one new thread to ask.

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 31 Oct 2008, 09:40
View user's profile Send private message Reply with quote
asmcoder



Joined: 02 Jun 2008
Posts: 784
asmcoder
[content deleted]


Last edited by asmcoder on 14 Aug 2009, 14:54; edited 1 time in total
Post 02 Dec 2008, 19:52
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
asmcoder wrote:
can you upload "Inside Windows"/"Windows Internals" plz?
Go buy the book, I don't think it's appropriate to warez stuff on the fasm board.

_________________
Image - carpe noctem
Post 03 Dec 2008, 00:03
View user's profile Send private message Visit poster's website Reply with quote
tom tobias



Joined: 09 Sep 2003
Posts: 1320
Location: usa
tom tobias
http://williamstallings.com/OS/OS5e.html
then, click on "student resources" to access a PDF file on Windows, if that is the operating system of interest to you.
Alternatively, I suggest trying the Homework problems for Stalling's book.
http://www.box.net/shared/5bllmdr10l
Here is another EXCELLENT resource:
http://en.wikibooks.org/wiki/Operating_System_Design
Smile
Post 03 Dec 2008, 13:28
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.