![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Synchronize your databases with SqlSync | iBot | UNIX and Linux RSS News | 0 | 05-08-2008 08:20 AM |
| how to synchronize different dirs | reldb | Shell Programming and Scripting | 1 | 12-09-2006 05:08 PM |
| Solaris 9: How to set time/Synchronize | 0ktalmagik | UNIX for Advanced & Expert Users | 3 | 07-16-2006 06:53 PM |
| How to synchronize all the linux machine? | whatisthis | Shell Programming and Scripting | 1 | 11-12-2004 08:07 AM |
| synchronize as in java | linuxpenguin | High Level Programming | 8 | 03-14-2004 06:02 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
need a way to synchronize processes
I am writing a program in C for my networking class, so I am relatively new to this.
To begin, I have 7 processes that need do send messages to every other one, and every one of them needs to receive the messages sent by others. I am using fork() to create 6 more processes. The message sending should be done through UDP sockets. So I create 6 sockets for sending using bind() and then I do sendto() After that the processes call receivefrom() The problem is that sometimes the process does not catch the sent message, and so the program keeps on waiting for the rest of messages. I try to rearrange sending and receiving, but ofcourse the scheduler does its own thing. I realize it needs a way to make them wait for each other, I am just not sure how to do it. Thank you for any help! |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Use a mutex or possibly a sempahore set to each value 1 - 6 (or whatever)
There are several ways to implement IPC - interprocess communication - Read chapter 5 here: Download Advanced Linux Programming |
|||
| Google The UNIX and Linux Forums |