Sponsored Content
Top Forums Programming Any one can tell me how this happen? Post 36438 by jiangyanna on Thursday 29th of May 2003 01:35:51 AM
Old 05-29-2003
thanks

Thanks!

And now i change my program like this:



Main(void)
{
int I;
printf(Ħ°%d,%d,%d \nĦħ,getpid(),getppid(),getpgid(0));
for(I=0;I<2;I++)
if (fork()==0)
printf(Ħ°%d\t%d,%d,%d \nĦħ,I,getpid(),getppid(),getpgid(0));
}

Result on screen:
59066,56414,59066 //parent print this
0 43282,59066,59066 //this is the first child process
1 27854,43282,59066 //first child process's child
1 5422,59066,59066 //second child process


Result on out.txt:
43306,56414,43306
43306,56414,43306
1 64390,1,43306
43306,56414,43306
0 58632,43306,43306
43306,56414,43306
0 58632,43306,43306
1 39766,1,43306

but how the race condition happen?I guess there is something going on in it's cache....

but i know when fork() produce a child process it will copy it's cache to the child's.

but does any body know the process of doing all these things(i mean from the child's birth to the death)

or anyone can give me some reference?

Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

what happen when changing Hostname?

I 'm using RH 7.2 Genome in the Network Configuration I change therer are two places one for static hostname for my machine and in DNS hostname I don't know what happen when restarting my PC when connecting using dialer I can't browse the Internet also I can't use sendmail .......Server timeout... (2 Replies)
Discussion started by: atiato
2 Replies

2. UNIX for Dummies Questions & Answers

What would happen if. . .

Hi, Could someone please tell me what would happen if the following were entered into the command line: rm -i /books/*.* rm /books/* Many thanks! (3 Replies)
Discussion started by: crispy
3 Replies

3. UNIX for Dummies Questions & Answers

How Do I Set a Task to Happen in the Future?

Is it possible to set a task to happen in the future? Say I want to log-off only after 10 hours of being logged on with out doing any activity in between? (2 Replies)
Discussion started by: Slick
2 Replies

4. Programming

What happen in registers Internaly using as in csl() function

Dear i do not understand that function used for clear screen (given below) cls { union REGS i,o; i.h.ah=6; i.h.al=0; i.h.ch=0; i.h.cl=0; i.h.dh=24; i.h.dl=79; i.h.bh=7; int86(16,&i,&o); } In Above function Registers are used(i think) but why and internally what the do for clearing... (3 Replies)
Discussion started by: brain_full
3 Replies

5. UNIX for Advanced & Expert Users

Unix ID deleted - What happen to process

I have an unix id (AIX system) which is used to run a couple of processes. They also write some log files into a file system (that is not in the home directory of the user id, but in different location). One bad day, the id was deleted accidentally. But the home directory, files and everything... (1 Reply)
Discussion started by: cmgreat
1 Replies

6. Shell Programming and Scripting

how to extract files one by one from a directory and let some processing happen

how to extract files one by one from a directory and let some processing be done on the file I have a directory by name INTRN which has files like INTR.0003080248636814 INTR.0003080248636816 INTR.0003080248636818 . . . . and so on and in a script... (5 Replies)
Discussion started by: saniya
5 Replies

7. UNIX for Dummies Questions & Answers

whats happen when we create new user

hi frndz I wanna knw exatly what happen when we create new user... which directories are created ?? which files are modified ?? thanx.... (2 Replies)
Discussion started by: luckypower
2 Replies

8. Programming

what would happen if a process wrote to its own stdin?

what would happen if a process wrote to its own stdin? #include<unistd.h> #include<fcntl.h> int main() { if((write(STDIN_FILENO,"arrgh!",6))==-1) { perror("error writing to file"); } } output: $ gcc temp.c $ ./a.out arrgh!$ (9 Replies)
Discussion started by: c_d
9 Replies

9. AIX

How does ITIL processing happen in AIX?

How does ITIL process is implemened in AIX? (6 Replies)
Discussion started by: AIXlearner
6 Replies

10. UNIX for Dummies Questions & Answers

When downloading a webpage by curl, what happen?

Hello, when im downloading an webpage from command line (CLI) by curl or wget the target website is loaded like i load it from browser? meaning target server connect to database and render data from mysql? Or only static content is downloaded? (2 Replies)
Discussion started by: postcd
2 Replies
ftpgroups(4)						     Kernel Interfaces Manual						      ftpgroups(4)

NAME
ftpgroups - group password file for use with the SITE GROUP and SITE GPASS commands. SYNOPSIS
DESCRIPTION
The file is the group password file for use with the SITE GROUP and SITE GPASS commands. To enable the use of this file, the entry must be made in the configuration file This file contains an alphanumeric string, encrypted password, and the actual group name from the file. Each entry is separated by After a user logs in, the SITE GROUP and SITE GPASS commands may be used to specify an enhanced access group and associated password. If the group name and password are valid, the user becomes (via a member of the group specified in the group access file, The format of the group access file is: where access_group_name is an arbitrary (alphanumeric and/or punctuation) string. encrypted_password is the password encrypted via crypt(3), exactly like in real_group_name is the name of a valid group listed in NOTE: For this option to work for anonymous FTP users, the ftp server must keep permanently open and the group access file is loaded into memory. This means that: (1) the ftp server now has an additional file descriptor open, and (2) the necessary passwords and access privileges granted to users via SITE GROUP will be static for the duration of an FTP ses- sion. If you have an urgent need to change the access groups and/or passwords *NOW*, then kill all of the running FTP servers. FILES
AUTHOR
was developed by the Washington University, St. Louis, Missouri. SEE ALSO
ftpaccess(4). ftpgroups(4)
All times are GMT -4. The time now is 05:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy