From: Abraham S. <ab...@ma...> - 2009-05-12 02:11:20
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=UTF-8" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Thank you all for your replies. <br> <br> We had gone through all the standard TCL documentation, including 8.6 beta and they were all the same. At the end, we went into the TCL source code for a clearer understanding. <br> <br> >From what we gathered, it appears that each vwait call is added to a stack. As such, the last vwait on the stack must be resolved first before the others are even processed. Thus, our suggestion of Chris Nelson's statement from wiki.tcl.tk.<br> <br> Detail description of how <b>vwaits </b>are resolved will enable clarity and certainty in code behaviour.<br> <br> Thank you.<br> <br> Regards.<br> Abe<br> <br> <hr size="2" width="100%"><br> Donal K. Fellows wrote: <blockquote cite="mid:4A0...@ma..." type="cite">Twylite wrote: <br> <blockquote type="cite">On this basis I support the proposal to have the above statement (or something similar) included in the man page. <br> </blockquote> <br> It seems like a reasonable request to me, though I'm not currently sure <br> what the text should actually look like. However, I think it's possible <br> to offer additional remedies in 8.6, where you can use a coroutine-based <br> scheme to write code that *looks* virtually identical to the bad old <br> [vwait]-based code, but which is in fact event-loop friendly. Thus it <br> would be good to at least indicate that this is possible in the docs, <br> making for a substantively different overall flavour... <br> <br> If someone were to file a bug about this (top-prio) so that it gets <br> sorted out in time for the next 8.5 and 8.6 releases, that would be a <br> very good deed. <br> <br> Donal. <br> <br> <blockquote type="cite"> <pre wrap="">I'm not a strong voice here but Twylite's request seems pretty reasonable, just including an example that shows the prob in the docs would be better. At my company we have a goal: "drive towards zero support costs". This request seems in line with that. If tweaking the docs means less people ask questions, why not? On Thu, May 07, 2009 at 09:37:52AM +0200, Twylite wrote: </pre> <pre wrap=""><span class="moz-txt-citetags">> </span>Hi, </pre> <blockquote type="cite"> <blockquote type="cite"> <pre wrap=""><span class="moz-txt-citetags">> >> </span>As such, we will like to request that the following statement <span class="moz-txt-citetags">> >> </span>extracted from wiki.tcl.tk/1302 by Chris Nelson to be included in the <span class="moz-txt-citetags">> >> </span>standard documentation: <span class="moz-txt-citetags">> >> </span> <span class="moz-txt-citetags">> >> </span> Multiple VWAITS NEST, THEY DO NOT HAPPEN IN PARALLEL. THE <span class="moz-txt-citetags">> >> </span>OUTERMOST VWAIT CANNOT COMPLETE UNTIL ALL OTHERS RETURN. <span class="moz-txt-citetags">> >> </span> </pre> </blockquote> <pre wrap=""><span class="moz-txt-citetags">> > </span>The standard documentation appears clear on this matter to me. <span class="moz-txt-citetags">> > </span>The entire second paragraph of the DESCRIPTION section is <span class="moz-txt-citetags">> > </span>devoted to discussing it. </pre> </blockquote> <pre wrap=""><span class="moz-txt-citetags">> </span>This has historically been a source of problems for new Tcl users, and I <span class="moz-txt-citetags">> </span>am inclined to feel (now that I have re-read it) that the 8.5 man page <span class="moz-txt-citetags">> </span>for vwait is a little too narrative and does not succinctly explain the <span class="moz-txt-citetags">> </span>behaviour of nested vwaits as the above proposal does. <span class="moz-txt-citetags">> </span> <span class="moz-txt-citetags">> </span>In fact it (the man page) fails completely to explain that unrelated <span class="moz-txt-citetags">> </span>vwaits can cause blocking. For example: <span class="moz-txt-citetags">> </span> after 500 { vwait b; puts "b was set" } <span class="moz-txt-citetags">> </span> after 1000 { set a 10 } <span class="moz-txt-citetags">> </span> vwait a <span class="moz-txt-citetags">> </span> puts "Never get here" <span class="moz-txt-citetags">> </span> <span class="moz-txt-citetags">> </span>This example has nothing to do with "the event handler that sets varName <span class="moz-txt-citetags">> </span>... not complete[ing] immediately" as described in the man page, but <span class="moz-txt-citetags">> </span>rather that the unrelated "vwait b" creates a new event loop which <span class="moz-txt-citetags">> </span>blocks "vwait a" until the "vwait b" returns. <span class="moz-txt-citetags">> </span> <span class="moz-txt-citetags">> </span>On this basis I support the proposal to have the above statement (or <span class="moz-txt-citetags">> </span>something similar) included in the man page. <span class="moz-txt-citetags">> </span> <span class="moz-txt-citetags">> </span>Regards, <span class="moz-txt-citetags">> </span>Twylite</pre> </blockquote> <blockquote type="cite"> <div class="moz-text-flowed" style="font-family: -moz-fixed; font-size: 16px;" lang="x-western">Abraham Saw <a class="moz-txt-link-rfc2396E" href="mailto:ab...@ma..."><ab...@ma...></a>: <br> <blockquote type="cite"> we have recently crashed into an inherent limitations in the VWAIT <br> commands which unfortunately was not clearly documented in the <br> standard documentation included in releases. <br> </blockquote> <br> That same documentation is online: <br> <br> <a class="moz-txt-link-freetext" href="http://www.tcl.tk/man/tcl8.4/TclCmd/vwait.htm">http://www.tcl.tk/man/tcl8.4/TclCmd/vwait.htm</a> <br> <a class="moz-txt-link-freetext" href="http://www.tcl.tk/man/tcl8.5/TclCmd/vwait.htm">http://www.tcl.tk/man/tcl8.5/TclCmd/vwait.htm</a> <br> <br> <blockquote type="cite">As such, we will like to request that the following statement <br> extracted from wiki.tcl.tk/1302 by Chris Nelson to be included in the <br> standard documentation: <br> </blockquote> <br> <blockquote type="cite"> Multiple VWAITS NEST, THEY DO NOT HAPPEN IN PARALLEL. THE <br> OUTERMOST VWAIT CANNOT COMPLETE UNTIL ALL OTHERS RETURN. <br> </blockquote> <br> The standard documentation appears clear on this matter to me. <br> The entire second paragraph of the DESCRIPTION section is <br> devoted to discussing it. <br> <br> What documentation are you looking at? <br> <br> DGP <br> <br> <br> <br> </div> </blockquote> <br> </blockquote> </body> </html> |