Can a thread be used to load something during ...
BlitzMax Forums/BlitzMax Beginners Area/Can a thread be used to load something during ...
| ||
an animation? Basically say I have an animation loading and I want to load in something else whilst it's playing, can I do that with threads in BMax so that both can happen at once? As at the moment, loading something big in just halts all processing until it's done. Thanks in advance for any advice? |
| ||
You could do it if Blitzmax supported threading. (it doesn't, does it??) |
| ||
gah! I used to use threads in Delphi. I was hoping it did. bummer. Right then I'll have to dig up some code someone wrote for "nibbling" files, sigh. |
| ||
What GfK said. Yes you can use a thread to load data (sitting in the I/O queue) while your main thread is running. This would speed up loading significantly, because your application isn't preempted because of the context switch (from running to I/O). BlitzMAX however has no love for threads. |
| ||
It's not that it can't be done though... The Linux FreeAudio driver uses a thread to stream the data to the audio device. |
| ||
Grey: Here's Beaker's nibble loader: http://www.blitzmax.com/Community/posts.php?topic=69959#783233 |
| ||
yeah that's the one I bookmarked a while back. May well have to use that... |
| ||
I guess you could write something in C using threads and then pass the data on to BlitzMax. |
| ||
Funny, when I read the thread title, I thought it said: Can a THREAT be used to load something during ... |
| ||
wow there's a name from the past, WolRon! |