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

  • SEARCH
  • Home
  • 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 7998999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:22:25+00:00 2026-06-04T15:22:25+00:00

I don’t really understand the difference between the user-level threads and kernel-level threads. This

  • 0

I don’t really understand the difference between the user-level threads and kernel-level threads. This is what i know so far:

Kernel-level threads

Advantages:

  • if we have multiple processors/cores we can actually run the threads simultaneously ( true parallelism because the kernels scheduler has control over the threads )
  • blocking a thread ( for I/O operations for example ) don’t block all the threads

Disadvantages:

  • context switch is made in kernel ( which means it’s slower than in user-space )

User-level threads

Advantages:

  • Faster context-switch
  • Scheduling can be planned in the application ( not by OS scheduler )

Disadvantages:

  • Kernel doen’t know anything about the threads so at most the process will use one processor/core at a time.
  • If one thread make a blocking call, all the threads will be be blocked again because the kernel has no knowledge about the existence of the threads, and the scheduler will give other process access to the processor/core, even though other threads in this program could run.

From what I know so far I can’t answer to this question:

How does the .text(code area) of the process modifies when a kernel-level thread is created?

My intuition says that it won’t change because the threads share the same address space, thus the .text area won’t change. Another reason I find to support this answer is that the .text area is read-only. Moreover all the others areas will remain the same(.bss, heap etc). The only one that will change is the stack.

However I want to be sure that this is the correct answer.

Note: I mainly talk about the threads on linux kernel(don’t know many stuff about windows threads)

  • 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-04T15:22:26+00:00Added an answer on June 4, 2026 at 3:22 pm

    There are 4 different types of threads that may be asked about here.

    1. Threads created by the kernel itself to handle background tasks.
    2. Processes forked by the fork() syscall.
    3. pthread threads which are created by the user with the Linux clone() syscall but are managed by the kernel
    4. “green” threads that run outside of the kernel scheduler entirely

    The following answer assumes that “user-level” threads mentioned in the post are the pthread variety and not the “green” variety.

    Edit: I think @Hristo is right and the OP is talking about “green” threads or is confusing the two.

    This answer assumes you are talking about threads that you create with pthread_create(). There are also “green” threads which are are scheduled by user-space and are unknown to the kernel. I’ll leave my answer here for posterity.


    User Threads == green threads

    So called “green threads” are by definition threads that are handled entirely by the VM without kernel involvement.

    “User-level” Kernel doen’t know anything about the threads so at most the process will use one processor/core at a time.

    Right.

    If one thread make a blocking call, all the threads will be be blocked again because the kernel has no knowledge about the existence of the threads

    No. As long as you using the right primitives, a blocking call will cause the thread to be put in a wait queue and another green-thread to be run.

    How does the .text(code area) of the process modifies when a kernel-level thread is created?

    In green-threads, they all use the same code area.

    Moreover all the others areas will remain the same(.bss, heap etc).

    Yes.


    User Threads == pthreads

    With pthread_create() “user-threads”, there is little difference between them and “kernel” threads. The linux kernel implements user-level threads as a separate kernel processes using the clone() system call. clone() creates a new process that uses the same memory space as the parent process as opposed to fork() which creates a new process with a copy of the parents memory.

    “User-level” Kernel doen’t know anything about the threads so at most the process will use one processor/core at a time.

    No, this is not correct. The kernel manages the user-level threads just like any other process in that there is context switching and the ability to schedule the various user-level threads on multiple CPUs, etc.

    If one thread make a blocking call, all the threads will be be blocked again because the kernel has no knowledge about the existence of the threads

    No, one threads can block and the other threads will continue to run. Again, this is under pthread style threads.

    How does the .text(code area) of the process modifies when a kernel-level thread is created?

    When a new thread is created, it inherits the memory segmentation tables of its parent. The text/code pages (and other read-only pages) are marked as read-only and the two threads share the memory for the lifetime of the threads. All read-write pages are also shared until a write is made to those sections by the new thread at which point the page is copied to another location (copy on write).

    Moreover all the others areas will remain the same(.bss, heap etc).

    No, the heap pages, and anything else that is not marked as read-only (including the stack that you mention), will be copied as soon as they are written to. I’m not sure about .bss sections but since they are initialized at runtime, I believe they are also read-write. DATA is read-only.

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

Sidebar

Related Questions

don't know better title for this, but here's my code. I have class user
I don't know whether this is really possible, but I'm trying my best. If
Don't know if this has been answered before. Have custom routes to users. If
Don't know why but I can't find a solution to this. I have 3
Don't really know how to formulate the title, but it should be pretty obvious
I don't know if this is a well known 'thing' or something new in
(Don't know if this is strictly on-topic, but I don't see any better Stack
Don't know if this has been asked before, so point me to another question
Don't know if anyone can help me with this or if it's even possible.
I don't know: if this works. if it's a good idea. what it is

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.