Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fread/fwrite/fflush bug




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:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden
References: 
 >fread/fwrite/fflush bug (From: Norm Green <email@hidden>)
 >Re: fread/fwrite/fflush bug (From: "Scott D. Davilla" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.