file read/write synchronization: advice needed

J

Junpei

problem: I have a program A that writes (overwrite) to a file 5
times/second (the results of a realtime calculation); i want several
other programs B through E to occasionally read that file to see what
the current results are (I only need the current results). how do i
keep the programs B to E from trying to read while program A is
writing? or is there a better solution than writing to a file? hoping
for an easy solution... i'm on linux.
thanks in advance,
Junpei
 
B

Ben Morrow

Quoth (e-mail address removed) (Junpei):
problem: I have a program A that writes (overwrite) to a file 5
times/second (the results of a realtime calculation); i want several
other programs B through E to occasionally read that file to see what
the current results are (I only need the current results). how do i
keep the programs B to E from trying to read while program A is
writing? or is there a better solution than writing to a file? hoping
for an easy solution... i'm on linux.

perldoc -f flock

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top