Yeeesss
I've implemented a message queue,
here I used two programs one for server that writes
the source file to message queue. And with other program
I read the message queue and writes into destination file.
so one section is over ....
Now as per the question , there must be 4 reader process.
And have to provide synchronization. Four reader process means what...??
Four reader processes concurrently reads message from
queue and writes into one destination file. Am I correct.?
So in which mode have to open the destination file .,,,Append mode ?
program1 :
1. open source file (read only)
2. create message queue.( msgget)
3. read file small block by block upto end of file.
4. writes into message queue and sends (msgsnd)
program2 :
1. open dest file (write mode)
2. Get existing message queue.( msgget)
3. Receives messages (msgrcv)
4. writes into message.text to dest file.
So this is my current status of programs.... Now I use only two processes. And I wanna change it with one process write in to queue and 4 processes reading from queue. In the above algorithm where should add semaphores..... have to make a concept critical section here.....
Any suggestions or helps....
with regards
KRISH