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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:37:45+00:00 2026-06-17T16:37:45+00:00

Possible Duplicate: After forking, are global variables shared? In my C program, I keep

  • 0

Possible Duplicate:
After forking, are global variables shared?

In my C program, I keep a struct linked list as a global variable.
Then later I fork a child process. Now in the child process if I free a node of the linked list, and then end the child process. Will the node be gone in the parent process as well?

When I was trying this, it seems the node was still there in the parent process…
Is this right? Why?

  • 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-17T16:37:46+00:00Added an answer on June 17, 2026 at 4:37 pm

    No, it won’t be gone in the parent process. The correct mental model is that the child is getting an independent copy of the parent’s memory. The two processes are not sharing the memory (not unless you explicitly set up a shared memory segment and place your data there).

    The situation is radically different if you use threads instead of processes. Threads running within the same process do share the address space.

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

Sidebar

Related Questions

Possible Duplicate: LISP - Global variable keep their old value after reinitialization I'm currently
Possible Duplicate: Determine original name of variable after its passed to a function. I
Possible Duplicate: What is useful about this C syntax? C variable declarations after function
Possible Duplicate: Setting variable to NULL after free … I am learning about good
Possible Duplicate: java - Array brackets after variable name When writing a Java function
Possible Duplicate: Troubles with a PHP session variable after form submission I use sessions
Possible Duplicate: Perl: How do you insert numbers after grouping variable? I have the
Possible Duplicate: C function syntax, parameter types declared after parameter list I saw the
Possible Duplicate: Remove characters after specific character in string, then remove substring? I have
Possible Duplicate: variables retaining values after app close I am relatively new to android

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.