Everything was working ok until this mornig. The program would not start. Kept displaying and error and refused the key. After reboot it worked fine.
Demi
I sent the data to you also
Crashing
7 posts
• Page 1 of 1
Hi Demi,
That's the most damnable error I’ve ever seen! Reading a text file, character by character, was returning the wrong value. This wasn't anything fancy either: good old fashioned fgetc(fp) was giving incorrect values. The best bit was that I could fix it by putting a 100-millisecond sleep in before starting to read the file. Something is very, very wrong with that. That should not work. Anyhow, I think I've fixed the problem (without really knowing why), so please download the latest update utility and have another go. Best regrds, Aaron.
Oh good, I'm glad that voodoo worked. The frustrating thing is that hard-disk speed (or any other system metric) should not come into this - the OS is supposed to guarantee that when you read a file you always get the right bits. If the disk is slow, then the function should take longer to execute, but it should still return the same value. Hrumpfh!
Hello,
I've finally worked out the reason for and proper resolution to this bug. When starting up, L3DT is loading several files and simultaneously writing to the debug.log file. Every time something is added to this file, L3DT flushes the file buffers to make sure the OS doesn't cache anything, which ensures everything gets written in case of a program crash. Flushing buffers, I now know, interferes with file loading operations. In single-threaded code you don't get this problem because everything is synchronous and sequential. However, the initialisation of L3DT is seriously multithreaded, so we get asynchronous and possibly parallel flush/read operations, which causes the train-wreck observed. By inserting a sleep, I've delayed one thread slightly, and bingo, no collision. A better option would be to set a semaphore when reading files that forbids buffer-flushing, but I'll only do this if the problem reoccurs (the sleep was an easy fix). Cheers, Aaron.
7 posts
• Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 54 guests |