Re: fread/fwrite/fflush bug
Re: fread/fwrite/fflush bug
- Subject: Re: fread/fwrite/fflush bug
- From: "A.M." <email@hidden>
- Date: Tue, 8 Jan 2008 11:07:49 -0500
On Jan 8, 2008, at 10:38 AM, Scott D. Davilla wrote:
I too am seeing a similar problem. In my case, We have one producer
thread that does an fopen for write only, and several consumer
threads that do fopen for read only. The consumer threads are only
able to read the number of bytes in the file that existed when the
fopen was called. They never see any additional data from the
producer thread.
These files can be very large, they are position (x,y) with
electron and x-ray events streamed in realtime from networked
hardware.
This is a real problem with our existing code as it's design
depends on the above ability. We just moved from CFM to Mach-O
(yea, yea, I know). Works fine with CW and CFM (and Borland, we are
cross-platform).
Any suggestions for a solution?
Don't use buffered I/O.
http://www.opengroup.org/onlinepubs/007908799/xsh/setvbuf.html
Or use a shared mmap().
Cheers,
M
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden