<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=US-ASCII">
<META content="MSHTML 6.00.2900.2802" name=GENERATOR></HEAD>
<BODY id=role_body style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Arial"
bottomMargin=7 leftMargin=7 topMargin=7 rightMargin=7><FONT id=role_document
face=Arial color=#000000 size=2>
<DIV>Hi, I have a situation that 1,000,000 tasklets are making frequent calls to
remote servers and waiting for reply. Each tasket is waiting for its own
reply. These tasklets are also created and removed frequently.<BR><BR>By
checking stackless's doc, I know I can create a new channel for each new tasklet
for making blocking call and make itself pause/sleep.<BR><BR>But it looks like
creating another model can make the code simpler and I don't have to create
1,000,000 channel objects.: <BR>1. after sending out request, pause the
tasklet by using remove() call<BR>2. use a reply manager to process reply
messages and wake up ( tasklet.run() ) the specific tasklet based on taskletID
in the reply<BR>3. reply manager kill taskets if they timeout ( I didn't see
channel have build-in timeout setting)<BR><BR>Please let me know I went to the
wrong path because of misunderstanding.<BR><BR>When looking at the remove() api,
I saw the following warning message about it:<BR><BR>
| remove(...)<BR> |
Removing a tasklet from the runnables queue.<BR>
| Note: If this tasklet has a non-trivial C stack
attached,<BR> | it will be
destructed when the containing thread state is
destroyed.<BR> | Since
this will happen in some unpredictable order, it may cause
unwanted<BR> |
side-effects. Therefore it is recommended to either run tasklets to
the<BR> | end or to
explicitly kill() them.<BR><BR>Does it mean it's not recommended to use remove()
if I am not sure about if non-trivial C stack has been attached ? <BR><BR>If
anyone can explain what is "containing thread" ( for example, is it a thread
generated by stackless internally ? the main watchdog thread or the
calling function of python?) and give an example how remove() might failed, I
will really appreciate. <BR><BR>Thanks in advanced.<BR><BR>-
Jim<BR><BR></DIV></FONT></BODY></HTML>