Has anyone else had any problems with sleep() hanging when used inside a Tk application? Most of the code uses $widget -> after() to get delays, but the code can "do" other scripts which can contain sleep(). The problem I'm seeing is that quite regularly, sleep(1) does not return. This is in 5.8.8 for win32. The win32 sleep seems to use MsgWaitForMultipleObjects with a count of 0 and a null list inside a while (1) loop. This is hence reliant on the timeout feature of the windows call (wait for nothing and time out after n ms?). When used with Tk, doing window events, like moving/resizing seems to make it hang. Anyone else seen this? Of course I could be barking up the wrong tree completely and it could be something else. This doesn't seem to happen when running the same code under Linux though. TIA, Shaun.

In reply to Tk and sleep() on win32 by lightspeed

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.