Python threading?

sismex01 at hebmex.com sismex01 at hebmex.com
Thu Sep 26 10:10:19 EDT 2002


> 
> I wonder if generators can come to a rescue here?
> Still trying to get them into my head...
> 
> Thomas
> 

I was thinking exactly the same thing, generators as
cooperative multithreading.

I wonder if a "task", or a "service", in an async server
could simply initialize and then "yield" when it's ready
to be paused, and between yield's do some processing.

The core server would simpy call the service factory when
it's requested, receive a generator back, add it to it's
pool of active services, and iteratively call every
generators ".next()" method, so everybody gets a bit of
attention and love each cycle.

You could even use priorities, something simple, where high-
priority services would receive a bit more attention every
complete cycle.

I dunno, but it's an idea who's time has time, I think.

:-)

-gus


Advertencia: 
La informacion contenida en este mensaje es confidencial y restringida y
esta destinada unicamente para el uso de la persona arriba indicada, Esta
comunicacion representa la opinion personal del remitente y no refleja
necesariamente la opinion de la Compañia. Se le notifica que esta
estrictamente prohibida cualquier difusion, distribucion o copia de este
mensaje. Si ha recibido esta comunicacion o copia de este mensaje por error,
o si hay problemas en la transmision, favor de comunicarse con el remitente.


Todo el correo electrónico enviado para o desde esta dirección será
procesado por el sistema de correo corporativo de HEB. Tal correo
electrónico esta sujeto a ser almacenado y puede ser revisado por alguien
ajeno al recipiente autorizado con el propósito de monitorear que se cumplan
las normas de seguridad de la empresa.




More information about the Python-list mailing list