I (sometimes) cant write my program file when a copy of it is running
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Actually it is question in an operating system course I am taking. We are currently studying memory management. That is why I know the answer has to do with memory management. I have search the text and internet and have not found any info that touches on this. I don't have access to Linux source as of this moment so I figure I'd put the question out the people with Linux experience.
Thank you for acknowledging that this is homework...
But now I am really confused as to what the question is. It now appears you are asking something purely hypothetical. If the question in fact relates to not being able to write to a file that is in use, I can't see how that is a memory management issue.
The question is not hypothetical as the instructor showed an example of it in class.
I think it has to do with the fact that when you change a program and recompile you change the virtual address space of the executable image. Since the text segment (shareable in Linux) is already in physical memory and being used by the copies already running, if the new version were to be run, it would be run with the old text segment. Something along those lines although I dont know, the reason for the question.
My take is that you do not understand the question. That being the case, how can we help with the answer?
You talk about compiling and running. When you run a binary (compiled program) it loads itself into memory**. When you quit, it frees the memory---the next time you run it, it could easily go somewhere else. In this context, what do you mean by the "text segment"?