-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Processes by Kevin Brack #369
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kevin, your code looks good! Just a few suggestions for your issue on ex5. Good luck! Let me know if I can help with anything.
printf("Greetings from child (pid: %d)\n", f); | ||
printf("Childs x: %i\n", x); | ||
printf("Childs pointer to x: %p\n", xp); | ||
printf("Childs pointer to x value: %i\n", *xp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I like how you experiment with pointers here.
char* msg1 = "hello world #1"; | ||
char* msg2 = "hello world #2"; | ||
char* msg3 = "hello world #3"; | ||
char *msg1 = "hello world #1"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you changed the spacing here, good. It's funny how something as small as spacing can give you clues about who the author of the code was.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. I love to use Prettier and format-on-save. As a highly visual learner it gives me a holistic impression of what good code should look like in each language.
ex5/ex5.c
Outdated
// we are in the parent branch | ||
for (int i = 0; i < 3; i++) | ||
{ | ||
wait(NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try taking your wait() call out of the for loop and see if that stops the program from hanging. You also might consider closing the "write" side fo the pipe with the close() call (also done outside of the for loop)although, I think that's less likely to be the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kevin, good job figuring out your issue with ex5. Everything here looks great! Let me know if you need anything.
No description provided.