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 7954763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:31:43+00:00 2026-06-04T03:31:43+00:00

in clone (2) man page, for child stack its mentioned that Since the child

  • 0

in clone (2) man page, for child stack its mentioned that

Since the child and calling process may share memory, it is not possible for the child 
process to execute in the same stack as the calling process.

can anybody please explain how “sharing memory” ,specifically, makes it impossible. OTOH, a common perception is that the function execution sequence in a thread will be different from others, so we need another stack there.

Thanks,
Kapil

  • 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-04T03:31:45+00:00Added an answer on June 4, 2026 at 3:31 am

    Two threads can’t use the same stack. They’d just mess it up for each other, and soon crash.

    When using fork, there’s no memory sharing. Both threads have the same value of the stack pointer, but it points to physically different memory pages.

    When using pthread_create, a new stack pointer is chosen for the new thread, separate from the parent. This way they don’t corrupt each other’s stack.

    clone is a low-level function, which is somewhere between the two. It keeps memory shared, so the threads must not shared the stack. But unlike pthread_create, the new stack pointer is determined by the user, which may choose it as he wishes. The sentence you quote warns that you should choose it with care.

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

Sidebar

Related Questions

So since I'm still wanting to create a simple Pac-Man clone by December, I'm
The recv() library function man page mention that: It returns the number of bytes
So, I'm going to develop a Pac-Man clone with Qt. The problem is that
The clone() system call on Linux takes a parameter pointing to the stack for
I can't clone my repository via http: abort: ' http://MYREPO ' does not appear
I am writing an API that uses sockets. In the API, I allocate memory
Reading the man page for close, if it's interrupted by a signal then the
I already read the man page of the pidfile function family. But I don't
Some PHP sites use a page to act as a middle man for handling
clone method vs copy constructor in java. which one is correct solution. where to

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.