• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: fread/fwrite/fflush bug
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


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

  • Prev by Date: Re: fread/fwrite/fflush bug
  • Next by Date: Re: fread/fwrite/fflush bug (Norm Green)
  • Previous by thread: Re: fread/fwrite/fflush bug
  • Next by thread: RE: fread/fwrite/fflush bug
  • Index(es):
    • Date
    • Thread