I haven't tried it using picolisp, but have used the basis in Python very much. The core module is "asyncore" in Python. The idea is quite simple, you manage a bunch of sockets, and just sleep on their 'read's (also write, but almost never) using 'select'. It would port to picolisp very nicely. And as far a performance: my original measurements put picolisp at about 10 times faster than python. I used python and asyncore to manage several BIG banks' complete control of their ATMs (asyncore was used as a packet gateway between X25 and TCP/IP). There were never any performance problems. Sorry: I don't have time right now to play with a model in picolisp, as much as I would like to do that. I am not sure whether 'task' is the best way, or a more direct interface to 'select'.

- Rand

konrad Zielinski wrote:
Hi Henrik

the whole idea of an asycronous server is that you only use one
process. to handle all requests. this way session data can be stored
without using an external symbols.

Even further several clients may share state in some way, though the
only example I can think of off the top of my head is a multiplayer
online game.

The performance asumption is that your server is I/O bound and not cpu
bound. Generally anytime you do something that may block you need to
differ that processing probably by adding the waiting resource as its
own task. And in the meantime move on to other processing such as
other waiting requests.

The only time I would spawn a new process is if a request needed
somthing very intensive done. We would then need to have a task
waiting on the other process to complete its work.

the idea is that your process is not allowed to block, so each time IO
is needed the currently executing code needs to be suspened, so that
the system can do something else without blocking. Twisted dose this
by breaking up larger lgoical units into small functions that
essentially sechdule a handler function to be handled when an external
resoult is ready as the last thing before returning.

I am operating at the limits of my understanding here and to be honest
I'm not certain how the whole differed processing model will translate
into picolisp. Though on the face of it, I think it should transfer
rather well.

The Task mechanism along with some other functions I reacal reading
about seem up to the job.



Reply via email to