[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
How does "fork()" work?
- From: Living Dead <gormozus yahoo com>
- To: redhat-list redhat com
- Subject: How does "fork()" work?
- Date: Wed, 28 Feb 2001 12:23:35 -0800 (PST)
I have the following code:
#define BUFFSIZE 32 * 1024 * 1024
int main()
{
char *a;
a = (char *)malloc(BUFFSIZE);
if (fork()) {
// Parent
free(a);
} else {
// Child
}
}
The question is:
Is there a risk to run out of memory?
To put it in another way:
If I allocate 32Mb of memory in the parent process,
then I call fork(), the amount of memory needed for
both parent and child is 64Mb?
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]