At 07:11 PM 1/5/01 +0000, [EMAIL PROTECTED] wrote:
>Nicholas Clark <[EMAIL PROTECTED]> writes:
> >> and maybe have the return data have some 'I/O complete' marker so
> async I/O
> >> will work out properly.
>
>Anyone that has experience in writing prefetch style code please weigh in
>with the pitfalls.
I'm in the middle of doing "real work" that does that sort of thing right
now. It's not really that bad--what you do is allow an optional callback
for each async I/O routine (which can take a parameter) and also associate
each one with a status blocks. When the I/O completes it fires off the
callback and also sets the status and a completion flag in the status
block. You can either poll the status block or have your callback routine
do stuff. (Or both)
It works pretty well, all things considered. Not the easiest way to
program, but async code's always a big pain in the neck.
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk