Preloading functions
Posted: Fri Feb 24, 2012 7:52 pm
Hi Andreas,
I'd like to post an idea on a method to implement preload/chaching without implement separate thread processes, but internally of course you should handle them asynchronously.
I was thinking about something like:
Then we could use the preload_id as pseudo filename in standard loading routines:
This could lead to istant loadings in many situations, or at least the wait could be reduced because the program should wait only for the reading completetion:
Just an idea 
Could it be possible?
I'd like to post an idea on a method to implement preload/chaching without implement separate thread processes, but internally of course you should handle them asynchronously.
I was thinking about something like:
Code: Select all
; Call an async loading routine for the given filename, if preload_id is Nil means that the Preloading has failed (file not found, etc...)
Local preload_id = Preload(filename)
; Check if the loading has been completed, result can be TRUE or FALSE
Local result = IsLoaded(preload_id)
Code: Select all
Local myBrush = LoadBrush(Nil, preload_id)
Code: Select all
...
While IsLoaded(preload_is)
...
Wend
Local myBrush = LoadBrush(Nil, preload_id)
Could it be possible?