Task class
Posted
#1
(In Topic #1393)
Regular

At present my first 'level' task instantiates fine, but any further task instantiation - within the first-level task - doesn't seem to work (no error or crashing, just nothing happening).
So I wondered, does anyone know that a task cannot run a further task - perhaps due to the Forking needed for tasks to work at all? *
*Why am I trying this?? Well in my main program, if I use the RDIR statement for very extensive/deep file structures, my 2-core processor can take up to 30secs to return the resulting file-paths array. So I thought, maybe a number of simultaneous Tasks could run DIR statements that would return the requisite file lists, both asynchronously (to the user program) and perhaps a bit faster too!
Any ideas on the Task calling Tasks issue, or a rapid way of returning file lists RDIR-style, gratefully received.
Happy New Year! everyone.
C.
Posted
Trainee
RDir was written in C and is very fast, in fact its speed is similar to an ls -Ra from shell and this depends on the speed of the disk and hardware in general.
Imagining having 2 simultaneous instances in the background to ask the same disk for 2 different directories with DIR would just waste the disk's time which can only fulfill one request at a time.
If you need the data all at once then there is only waiting.
If, on the other hand, you need them as the directory tree is visited by the user, you could build the tree with only the subdirectories with 1 level of depth and eventually read with a task the contents of only the subdirectories one level down (or up)
Posted
Regular

In my program, I will now be looking at being much more selective about returning full file-stats of potentially 'deep' directories.
Thanks again.
C
1 guest and 0 members have just viewed this.



