Hi Tomas,

> >> I am wondering how/when picolisp calls the asynchronous handler?  Is
> >
> > This happens in the functions 'wait', 'sync', 'listen' and 'key', or
> > when waiting for user input at the console.
> ...
> It looks like it also happens during 'tell' and/or (any?) I/O which

There is no other place where the internal event loop (the C-function
waitFd()) is called.


> Which makes me think that if a handler uses IPC or calls any of the
> above functions, it might get recursive.

This is possible, and in fact sometimes desired. For example, in
database I/O, the function 'dbSync' (lib/db.l:750) plays a central role.
It calls both 'wait' and 'sync', which in turn invoke the event loop.
And most probably the database processing will happen in response to
another event.

As you can see in 'dbSync', you can control the events installed by
'task' by manipulating the '*Run' variable.


> I should probably avoid that
> and only queue things to do in a handler and do them in the main loop
> only.

I'm wondering whether the 'fifo' is really necessary?


> And for that it uses locks, doesn't it?  I wanted to avoid locks in
> phil.l because that was the whole point of Chandy / Misra solution;-)

Yes, that's right.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to