2 registered members (AndrewAMD, dr_panther),
730
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Multi-threading (for A8) guru needed.
[Re: WretchedSid]
#384596
10/05/11 09:29
10/05/11 09:29
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
OP
Expert
|
OP
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Sorry guys, Im afraid I STILL havent done a real read-through the last few posts. But I will!
I'm busy fighting my file-reader coding ATM. Pointer issues... no surprise! Im NOT looking for help on that though, cause I need to get back up-to-speed with pointers anyway, and I'll get there soon enough. Then I'll get back on track with my thread testing.
But in the meantime, as an off-topic (hey! Its MY thread, I can do it!), can anyone answer these API questions?
1> The "FileCreate" in my sample code is causing a noticable 'lag' when FIRST opening the file in question. This makes me suspect that the WHOLE file is being cached somewhere. Is my suspicion correct?
2> Is this file being cached INSIDE the acknex workspace, or is it being cached by the OS somewhere outside? ( my diagnostic attemps were inconclusive)
3> Is there any way to prevent the cacheing, or to limit the size of the 'chunk' being cached? (for this ONE file, and from within API)
For these questions, I need to TRY and keep with OpenFile for its ability to allow control of the internal file pointer when retrieving data.
Thanks guys.
PS: Damn, this off-topic nearly deserves its own thread, but we'll see how it goes. Maybe later.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Multi-threading (for A8) guru needed.
[Re: Bunsen]
#385108
10/13/11 04:16
10/13/11 04:16
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
OP
Expert
|
OP
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
OK, Im finally back. I was doing a rebuild of my work-pc (where I do my lite-c work), and it went horribly wrong when I connected to the network...
Bunsen: 1> It must just be cacheing either a large chunk, or it is the OS trying to 'find' the file. (deep path ATM)
2> Then do you know if the default.c diag panel shows this memory usage? I couldnt see any change...
3> I have since discovered CreateFile CAN read non-buffered, but it gets ugly. You need your own buffer/chunksize to match the HDD clustersize(simplified description)
>> If I open the file using CreateFile, I can move the 'readfrom' position manually using the 'SetFilePointer' API. That way I could openfile, read a bit, skip a bit, read a bit, etc, close. NEVER going backwards.
BUT, since then, Ive decided I want to use a zip-library in my app to reduce the file-size. Buffering becomes a necessity then, so Ive dropped the whole no-buffer idea completely.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Multi-threading (for A8) guru needed.
[Re: EvilSOB]
#385110
10/13/11 04:35
10/13/11 04:35
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
OP
Expert
|
OP
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
OK everyone, this thread is now actually, RESOLVED, but I cant update the thread heading anymore.
Iv looked at eryones stuff (to varying degrees) and appreciate all your input, every little bit helped.
I have ended up going in the following directions...
1> The vertex-displacement thread has been abandoned and merged into the buffering function. ent_getvertex was too unreliable in a thread, and syncronising the thread not worth the effort.
2> The datafile-read thread is working nicely without a 'standard' mutex system. I am using a pointer shared between both threads as a mutex, and a shared flag to terminate all threads. I can post the code if someone wants, I just dont have that usb-stick installed ATM...
Thanks all for your inputs...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|