Thursday , November 21 2019
Home / Windows / What is multi-threading operating system

What is multi-threading operating system

What is multi-threading operating system

A thread is a flow of execution through the process code, with its own program counter, system registers and stack. A thread is also called a light weight process. Threads provide a way to improve application performance through parallelism. Threads represent a software approach to improving performance of operating system by reducing the overhead thread is equivalent to a classical process. Each thread belongs to exactly one process and no thread can exist outside a process. Each thread represents a separate flow of control. Threads have been successfully used in implementing network servers and web server. They also provide a suitable foundation for parallel execution of applications on shared memory multiprocessors. Following figure shows the working of the single and multi threaded processes.

Read:- What is operating system processes

What is multi-threading operating system

This section describes thread, types of threads and various thread models.

What is multi-threading operating system

Differences between Process and Thread?

What is multi-threading operating system

Advantages of Thread

  • Thread minimizes context switching time.
  • Use of threads provides concurrency within a process.
  • Efficient communication.
  • Economy- It is more economical to create and context switch threads.
  • Utilization of multiprocessor architectures to a greater scale and efficiency.

Types of Thread

Threads are implemented in following two ways.

User Level Threads:- User managed threads.
Kernel Level Threads:- Operating System managed threads acting on kernel, an operating system core.

User Level Threads

In this case, application manages thread management kernel is not aware of the existence of threads. The thread library contains code for creating and destroying threads, for passing message and data between threads, for scheduling thread execution and for saving and restoring thread contexts. The application begins with a single thread and begins running in that thread.

What is multi-threading operating system

Advantages

  • Thread switching does not require Kernel mode privileges.
  • User level thread can run on any operating system.
  • Scheduling can be application specific in the user level thread.
  • User level threads are fast to create and manage.

Disadvantages

  • In a typical operating system, most system calls are blocking.
  • Multi-threaded application cannot take advantage of multiprocessing.

Kernel Level Threads

In this case, thread management done by the Kernel. There is no thread management code in the application area. Kernel threads are supported directly by the operating system. Any application can be programmed to be multi-threaded. All of the threads within an application are supported within a single process. The Kernel maintains context information for the process as a whole and for individuals’ threads within the process. Scheduling by the Kernel is done on a thread basis. The Kernel performs thread creation, scheduling and management in Kernel space. Kernel threads are generally slower to create and manage than the user threads.

Advantages

  • Kernel can simultaneously schedule multiple threads from the same process on multiple processes.
  • If one thread in a process is blocked, the Kernel can schedule another thread of the same process.
  • Kernel routines themselves can multi-threaded.

Disadvantages

  • Kernel threads are generally slower to create and manage than the user threads.
  • Transfer of control from one thread to another within same process requires a mode switch to the Kernel.

Multi-threading Models

Some operating system provides a combined user level thread and Kernel level thread facility. Solaris is a good example of this combined approach. In a combined system, multiple threads within the same application can run in parallel on multiple processors and a blocking system call need not block the entire process. Multithreading models are three types

  • Many to many relationship.
  • Many to one relationship.
  • One to one relationship.

Many to Many Model

In this model, many user level threads multiplexes to the Kernel thread of smaller or equal numbers. The number of Kernel threads may be specific to either a particular application or a particular machine. Following diagram shows the many to many model. In this model, developers can create as many user threads as necessary and the corresponding Kernel threads can run in parallels on a multiprocessor.

What is multi-threading operating system

Many to One Model

Many to one model maps many user level threads to one Kernel level thread. Thread management is done in user space. When thread makes a blocking system call, the entire process will be blocks. Only one thread can access the Kernel at a time, so multiple threads are unable to run in parallel on multiprocessors. If the user level thread libraries are implemented in the operating system in such a way that system does not support them then Kernel threads use the many to one relationship modes.

What is multi-threading operating system

Difference between User Level & Kernel Level Thread?What is multi-threading operating system

I hope that you understand my post. if you like this post then share my post, and comment on my post if you have any suggestion or Queries related to Operating system multi-threading. Thank you!

Check Also

How to install mac os in virtual box

How to install mac os in virtual box macOS first came out in 2001, and …

40 comments

  1. Most of whatever you mention happens to be supprisingly legitimate and it makes me ponder the reason why I had not looked at this with this light previously. This piece truly did turn the light on for me personally as far as this subject matter goes. Nonetheless there is just one position I am not too comfy with so while I make an effort to reconcile that with the core theme of the point, let me observe what the rest of the visitors have to say.Well done.

  2. Undeniably consider that that you said. Your favourite reason seemed to be at the internet the simplest factor to have in mind of. I say to you, I certainly get irked whilst other people consider concerns that they plainly do not know about. You managed to hit the nail upon the top and also outlined out the entire thing with no need side-effects , folks could take a signal. Will likely be again to get more. Thank you

  3. Does your blog have a contact page? I’m having problems locating it but, I’d like to send you an e-mail. I’ve got some ideas for your blog you might be interested in hearing. Either way, great blog and I look forward to seeing it improve over time.

  4. What i do not understood is in truth how you are not actually a lot more
    well-preferred than you may be right now. You’re very intelligent.

    You know therefore considerably in relation to this matter, produced me personally believe it from so many numerous angles.
    Its like men and women don’t seem to be interested until it
    is something to accomplish with Lady gaga! Your personal stuffs outstanding.
    All the time handle it up!

  5. Excellent beat ! I wish to apprentice while you amend your site, how could i subscribe for a blog site?
    The account aided me a acceptable deal. I had been tiny bit
    acquainted of this your broadcast offered bright clear idea

  6. Hi to all, how is the whole thing, I think every one is getting more from this web site, and
    your views are fastidious in support of new people.

  7. What’s Going down i am new to this, I stumbled upon this I have found It positively helpful and it has helped me out loads.
    I’m hoping to contribute & help other users like its aided me.
    Good job.

  8. Since the admin of this web site is working, no question very shortly it will be well-known, due to its quality contents.

  9. Nice answer back in return of this question with firm arguments and describing everything concerning that.

  10. Hello! I realize this is kind of off-topic but I had to ask.
    Does building a well-established website such as yours require
    a lot of work? I’m completely new to running a blog but I do
    write in my journal everyday. I’d like to start a blog so I will be able to share my experience and thoughts online.
    Please let me know if you have any recommendations or tips
    for brand new aspiring bloggers. Appreciate it!

  11. Keep this going please, great job!

  12. You could certainly see your expertise within the article you write.
    The arena hopes for even more passionate writers like you who aren’t afraid to mention how they believe.
    At all times follow your heart.

  13. Good post. I absolutely appreciate this website. Keep writing!

  14. Heya i am for the first time here. I came across this
    board and I find It truly useful & it helped me out much.
    I hope to give something back and aid others like you helped me.

  15. You’ve made some really good points there. I looked on the internet for more
    information about the issue and found most individuals will go
    along with your views on this web site.

  16. First of all I would like to say great blog!
    I had a quick question which I’d like to ask if
    you don’t mind. I was interested to know how
    you center yourself and clear your thoughts
    before writing. I have had difficulty clearing my mind
    in getting my thoughts out. I do enjoy writing but
    it just seems like the first 10 to 15 minutes
    are usually lost just trying to figure out how to begin.
    Any suggestions or hints? Thanks!

  17. There is certainly a great deal to find out about this topic.

    I love all the points you made.

  18. Greetings from Los angeles! I’m bored to tears at work so I
    decided to check out your blog on my iphone during lunch break.
    I really like the knowledge you present here and can’t wait to take a look when I get home.

    I’m shocked at how quick your blog loaded on my mobile .. I’m not even using WIFI, just 3G ..

    Anyways, very good blog!

  19. Unquestionably consider that that you said. Your favorite justification seemed to be at the net the simplest thing to be aware
    of. I say to you, I certainly get annoyed whilst other folks consider worries that they plainly don’t know about.
    You managed to hit the nail upon the highest and outlined out the whole thing without having side
    effect , other folks could take a signal. Will probably be back to get more.
    Thanks

  20. This excellent website really has all the information I needed concerning this subject and didn’t know who to ask.

  21. Hi, I think your blog might be having browser compatibility
    issues. When I look at your blog site in Ie, it looks fine but when opening in Internet Explorer, it has some overlapping.
    I just wanted to give you a quick heads up!
    Other then that, terrific blog!

  22. As the admin of this web site is working, no hesitation very shortly
    it will be well-known, due to its quality contents.

  23. WOW just what I was searching for. Came here by searching for cosplay
    costumes

  24. Aw, this was an incredibly good post. Spending some
    time and actual effort to generate a top notch article… but what can I say… I hesitate a lot
    and don’t manage to get anything done.

  25. Post writing is also a fun, if you be acquainted with then you can write otherwise it is complicated
    to write.

  26. It’s amazing to pay a visit this website and reading the
    views of all colleagues about this paragraph, while I am also keen of getting familiarity.

  27. Definitely believe that which you stated. Your favourite reason seemed to
    be on the net the simplest factor to have in mind of. I say
    to you, I certainly get annoyed whilst folks think about concerns that they plainly do not realize about.
    You managed to hit the nail upon the highest as neatly as outlined out the whole thing without
    having side effect , other people can take a signal.
    Will probably be back to get more. Thanks

  28. Thank you for some other great post. The place else could anybody get that kind of info in such a perfect means of writing?

    I’ve a presentation subsequent week, and I am on the search
    for such information.

  29. Good day! I simply want to offer you a huge thumbs
    up for your excellent info you’ve got right here on this post.

    I’ll be returning to your site for more soon.

  30. Thanks , I have recently been looking for info approximately
    this topic for ages and yours is the best I have found out till
    now. But, what in regards to the bottom line? Are you certain about
    the source?

  31. Everything is very open with a really clear
    description of the challenges. It was definitely informative.
    Your website is extremely helpful. Thanks for sharing!

  32. Nice blog! Is your theme custom made or did you download it from somewhere?
    A theme like yours with a few simple adjustements would really make my blog shine.
    Please let me know where you got your design. Kudos

  33. Greetings! I’ve been reading your web site for some time now and finally got the courage to go
    ahead and give you a shout out from Kingwood Texas! Just wanted to tell you keep
    up the excellent work!

  34. Greetings! This is my first comment here so I just wanted to give a quick shout out
    and tell you I really enjoy reading through your posts.
    Can you recommend any other blogs/websites/forums that go over the same topics?

    Thank you so much!

  35. This is the perfect blog for anyone who would like to understand
    this topic. You realize a whole lot its almost hard
    to argue with you (not that I personally will need to…HaHa).

    You definitely put a brand new spin on a subject that has been written about for ages.

    Wonderful stuff, just great!

  36. Hmm it seems like your blog ate my first comment (it was super long) so I guess I’ll just sum it up what I wrote and say, I’m thoroughly enjoying your blog.
    I too am an aspiring blog blogger but I’m still new to
    the whole thing. Do you have any tips for inexperienced blog writers?
    I’d genuinely appreciate it.

  37. Really nice information that you shared in this post.

  38. I absolutely appreciate your help. This exta slice of information will likely be put in place.

  39. I appreciate you sharing this great article. It has genuinely helped me.

  40. Incredible points. Great arguments. Keep up the great work.

Leave a Reply

Your email address will not be published. Required fields are marked *