Can a thread be used to load something during ...

BlitzMax Forums/BlitzMax Beginners Area/Can a thread be used to load something during ...

Grey Alien(Posted 2007) [#1]
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?


GfK(Posted 2007) [#2]
You could do it if Blitzmax supported threading.

(it doesn't, does it??)


Grey Alien(Posted 2007) [#3]
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.


FlameDuck(Posted 2007) [#4]
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.


Brucey(Posted 2007) [#5]
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.


xlsior(Posted 2007) [#6]
Grey: Here's Beaker's nibble loader: http://www.blitzmax.com/Community/posts.php?topic=69959#783233


Grey Alien(Posted 2007) [#7]
yeah that's the one I bookmarked a while back. May well have to use that...


Azathoth(Posted 2007) [#8]
I guess you could write something in C using threads and then pass the data on to BlitzMax.


WolRon(Posted 2007) [#9]
Funny, when I read the thread title, I thought it said:
Can a THREAT be used to load something during ...


Grey Alien(Posted 2007) [#10]
wow there's a name from the past, WolRon!