Subject: Re: [Haskell-cafe] Re: ACIO versus Execution Contexts
From: Lennart Augustsson <[email-masked]>
To: Adrian Hey <[email-masked]>
Date: Tue, 30 Nov 2004 16:02:10 +0100

Adrian Hey wrote:
> Keean and Lennart are just hiding the problem in a hypothetical
> "operating system" which is simply assumed to be correct (it just
> doesn't do any of the dangerous things that might otherwise be done).

Well, if think I'm not reading your postings then I think I can claim
you're not reading mine either.  :)

You seem to be writing part of an operating system in Haskell.
In that case you are responsible for handling the devices correctly.
I'm trying to convince you that a TWI is not the right way.

Having a TWI will give you some security against multiple uses
of the same device, but it won't protect you against everything.
* What if I have another driver for the same device?  They can't
   share the TWI.
* What if I have two identical devices?  They should not share the TWI.

I reiterate:  not even device drivers written in C use TWIs.
(Well, at least not quality drivers. :))

You need a device framework that does the right thing for you.
And you have to write it yourself.

So, for interfacing to bad C libraries I see the need for a TWI.
But you are writing the device driver yourself.  You have the chance
to get it right.

	-- Lennart