Processes by Kevin Brack#369
Processes by Kevin Brack#369KevinBrack wants to merge 10 commits intobloominstituteoftechnology:masterfrom
Conversation
TheDeterminator
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
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.
TheDeterminator
left a comment
There was a problem hiding this comment.
Kevin, good job figuring out your issue with ex5. Everything here looks great! Let me know if you need anything.
No description provided.