Re: In the Shallow End



"GreyCloud" <mist@xxxxxxxxxxx> wrote in message
news:FY-dnTj_LuvZI3vZnZ2dnUVZ_s-dnZ2d@xxxxxxxxxxxxxx

It isn't just the ISAM part, but also how their asynchronous I/O works
with their hard drives coupled with the o/s.

This was a great feature of VMS.

Naturally, MS copied it for NT. :D

And naturally doesn't work well in NT.

Works better, actually. VMS async I/O has
a nasty flaw; the completion procedures act
like interrupts, transfering control to your
callback at an arbitrary point in your thread.

This is very hard to cope with. It's like
thread synchronization- you cannot access
any shared data structures without some kind
of synchronization.

But normal synchronization primitives don't
work, because they are based on blocking;
and obviously interrupt-like code can't block
without deadlocking on the interrupted thread.

I remember when, many years ago, I tried to use
sys$qio; never could get it to work reliably.
I did not then understand why, but this was the
problem.

Windows fixes this by introducing 'alertable
waits'; these are like normal blocking operations
but they- and only they- can be interrupted for
completion procedures. You simply use these
when no locks are being held, and then
completion procedures can synchronize
normally, like threads do.

You can also spin up a thread which does
nothing but enter alertable waits. This
thread will then service your completion
procs immediately, but it can still synchronize
like any other thread.

[snip]


.



Relevant Pages

  • Re: In the Shallow End
    ... a nasty flaw; the completion procedures act ... like interrupts, transfering control to your ... But normal synchronization primitives don't ... these are like normal blocking operations ...
    (comp.sys.mac.advocacy)
  • Interrupt Synchronization - WDF driver
    ... I am getting interrupt synchronization problems for my PCI device WDF driver ... interrupts using different enable registers. ... In SMP pc's, while generating multiple interrupts continuosly in very short ...
    (microsoft.public.development.device.drivers)
  • Re: [patch 00/21] mutex subsystem, -V14
    ... >> need it, since DMA will never matter, and interrupts are precise. ... > I think the isync is necessary to keep heavily out of order processors ... the asm/spinlock.h ops are only built on SMP kernels. ... On UP the only synchronization needed is when a device reads/writes ...
    (Linux-Kernel)