Announcement

Collapse

Maintenance

The forum could be offline for 30-60 minutes in the very near future for maintenance (said 3pm Pacific). I was behind on getting this notice. I do apologize.
See more
See less

PB Executing too fast!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PB Executing too fast!


    Hi,

    After writing several files to disk, I attempt to open one of the
    files immediately after the write, which causes an error from
    my dll.

    When I waste about a second of time after the writes, I don't
    get the errors and everything is fine!

    Is this a flushing problem that or is PB just too fast?
    Anyone having any experiences like this on a 1Ghz Computer?

    Thanks
    Mike
    mwm

  • #2
    Michael,

    I struck the problem a long time ago and the solution was to
    flush after each file was written. Windows maintains an internal
    cache which can be broken with continuous disk writes so you must
    flush after each write to avoid the problem.

    Regards,

    [email protected]

    ------------------
    hutch at movsd dot com
    The MASM Forum

    www.masm32.com

    Comment


    • #3
      I always close/re-open shared files after update. This is 100% garantee.
      Should note that I found this problem at the begining of my work with IBM PCes
      (before appearence of Windows 3.1 )


      ------------------
      E-MAIL: [email protected]

      Comment


      • #4
        The problem is due to a design-quirk of Windows NT and is documented in MSDN. The NT's file handling is multi-threaded, so files can momentarily appear incomplete or missing because a scheduled thread has not completed. Flushing the files, or close/reopen technique should work acceptably.

        I know that we've researched and posted on this topic on the BBS before. I'll see if I can locate the previous discussions...

        ------------------
        Lance
        PowerBASIC Support
        mailto:[email protected][email protected]</A>
        Lance
        mailto:[email protected]

        Comment


        • #5
          Steve, Semen, Lance...

          Thanks for info guys...I knew it must of had something to do
          with the o/s.

          Thanks again!
          Mike
          mwm

          Comment

          Working...
          X