[E-Lang] multithreading
Bill Frantz
frantz@pwpconsult.com
Thu, 19 Jul 2001 19:22:12 -0700
At 4:50 PM -0700 7/19/01, Jonathan S. Shapiro wrote:
>> The basic logic of the UART way is that the handler gets an interrupt
>> (message) saying that either the transmit buffer is empty, or that there
>is
>> a character in the receive buffer. It then does:...
>>
>> I think this kind of logic maps to E without much difficulty
>
>You are glossing over something \important. That interrupt is a *preemptive*
>message causing a change in the active thread of control. This is the part
>that does not appear (to me) to map easily onto E.
The E program which follows this logic is available most of the time. So
is the interrupt level UART handler. The E program can not be interrupted
while it is executing, just like the UART handler. (In a more complex
system, where interrupts are taken while the kernel is processing, the
interrupts would be queued by software. Allowing the UART interrupts to
restart the handler before it had finished is the path of madness.)
I admit, if the E program is in the same vat with a long-running process,
it's execution will be delayed. But that delay will also effect the
messages saying that the transmit buffer is empty, mostly resulting in a
loss of performance, not the timely recognition of a XOFF.
Cheers - Bill
-------------------------------------------------------------------------
Bill Frantz | The principal effect of| Periwinkle -- Consulting
(408)356-8506 | DMCA/SDMI is to prevent| 16345 Englewood Ave.
frantz@pwpconsult.com | fair use. | Los Gatos, CA 95032, USA