<div>I can think of at least one situation when this could occur, involving Channel Preference of 1 (Sender):</div>
<div> </div>
<div>Channel N is created with preference 1</div>
<div>Tasklet A and B start</div>
<div>Tasklet A runs, receives on N, and blocks</div>
<div>Tasklet B sees N has balance -1, so sends to N. Due to Preference, B will not yield, instead A is placed at end of runnables queue. The channel's balance is now 0.</div>
<div>Tasklet B continues running, sees N has a balance of 0, so does not send. Repeat ad infinitum. Tasklet B never explicitly schedules or gets blocked otherwise, and so A never wakes up.</div>
<div><br><br> </div>
<div class="gmail_quote">On Fri, Jul 10, 2009 at 7:32 PM, Richard Tew <span dir="ltr"><<a href="mailto:richard.m.tew@gmail.com" target="_blank">richard.m.tew@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">On Sat, Jul 11, 2009 at 2:48 AM, Paul Sijben<<a href="mailto:sijben@eemvalley.com" target="_blank">sijben@eemvalley.com</a>> wrote:<br>
> I tracked down a bug in my code that occasionally popped up to<br>> channel.balance being wrong sometimes.<br>><br>> Some part of my code can not afford to block, so it checks the balance<br>> wheter it should send something into the channel. If there is a receiver<br>
> waiting on it, that is fed by a send and the sender will not block. Now<br>> I find that just occasionally the process stalls because there is a<br>> receiver waiting but the sender does not send as channel.balance==0<br>
> instead of -1!<br>><br>> I am running the current 2.6.2 version of stackless<br>> (Python 2.6.2 Stackless 3.1b3 060516 (python-2.6.2:73804M, Jul 3 2009,<br>> 11:33:51) )<br>><br>> Is this issue known, and possibly solved in svn?<br>
<br>This issue is not known. It is the first someone has even suggested<br>it might be happening. During the eight years or so I was at C.C.P.,<br>I never saw the likes of it.<br><br>I would be inclined to believe that there was something wrong with<br>
your logic, rather than the channel code. And without a reproduction<br>case, it is unlikely that it will ever be reproduced unfortunately.<br><br>Cheers,<br>Richard.<br><br>_______________________________________________<br>
Stackless mailing list<br><a href="mailto:Stackless@stackless.com" target="_blank">Stackless@stackless.com</a><br><a href="http://www.stackless.com/mailman/listinfo/stackless" target="_blank">http://www.stackless.com/mailman/listinfo/stackless</a><br>
</blockquote></div><br>