Re: Multitasking Preview Release
Al Getz wrote:
> Looks interesting...just two questions...
>
> 1. Will it allow a task to be interrupted when doing disk i/o?
You would need to use asynchronous I/O. There are API calls in Windows
and Linux/FreeBSD that let you initiate a chunk of I/O, and then
check periodically to see when it has finished. You can do other stuff
while the I/O is happening. So you might have a task in charge of
reading in a large (or slow) block of data. It could yield after
starting the I/O, and get control back periodically from the
scheduler so it can check if the I/O is finished.
Another, less fancy, approach would be to give a task the job of
reading in a file. It could maybe read one line at a time and
then yield control to the scheduler. For instance an editor could
be up and running quickly, and handling commands, while a background task
is still reading in the file. You'd have to be careful of course.
Also, in this day and age, the file would have to be huge for this
to be worthwhile.
> 2. Does it work using Windows also?
Yes it does.
You might have a task that performs doEvents() while other
tasks are doing other processing. I didn't make a Windows demo
because I thought the DOS demos would show the tasking primitives
more clearly. I, or maybe someone else, should develop nice
Windows and Linux/FreeBSD demos.
Regards,
Rob Craig
Rapid Deployment Software
http://www.RapidEuphoria.com
|
Not Categorized, Please Help
|
|