Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7727015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:21:14+00:00 2026-06-01T05:21:14+00:00

There are many solutions geared toward implementing user-space threads. Be it golang.org goroutines, python’s

  • 0

There are many solutions geared toward implementing “user-space” threads. Be it golang.org goroutines, python’s green threads, C#’s async, erlang’s processes etc. The idea is to allow concurrent programming even with a single or limited number of threads.

What I don’t understand is, why are the OS threads so expensive? As I see it, either way you have to save the stack of the task (OS thread, or userland thread), which is a few tens of kilobytes, and you need a scheduler to move between two tasks.

The OS provides both of this functions for free. Why should OS threads be more expensive than “green” threads? What’s the reason for the assumed performance degradation caused by having a dedicated OS thread for each “task”?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:21:15+00:00Added an answer on June 1, 2026 at 5:21 am

    I want to amend Tudors answer which is a good starting point. There are two main overheads of threads:

    1. Starting and stopping them. Involves creating a stack and kernel objects. Involves kernel transitions and global kernel locks.
    2. Keeping their stack around.

    (1) is only a problem if you are creating and stopping them all the time. This is solved commonly using thread pools. I consider this problem to be practically solved. Scheduling a task on a thread pool usually does not involve a trip to the kernel which makes it very fast. The overhead is on the order of a few interlocked memory operations and a few allocations.

    (2) This becomes important only if you have many threads (> 100 or so). In this case async IO is a means to get rid of the threads. I found that if you don’t have insane amounts of threads synchronous IO including blocking is slightly faster than async IO (you read that right: sync IO is faster).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are many solutions for third-party decentralized authentication that are pretty simple to set
Firstly I know that there are many question and solutions to correct thread marshalling
I'm new at javascript and while there are many more complex solutions, I don't
There are many visual studio solutions on our company svn, with different teams working
I expect there are many possible solutions to this question, I can come up
There are many great solutions for mobile detection out on the web such as
Is that a problem if a solution contains many projects and there are some
I have three solutions which build two clients and a server, and share many
There are many ASP.MVC blog post bits and pieces scattered over different web sites,
There are many ways of doing debugging, using a debugger is one, but the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.