Re: assess what subroutines are currently being called

listmail <[email protected]> Wed, 11 Apr 2007 13:37:31 -0400
Newsgroups gmane.comp.lang.perl.tk
Message-ID <[email protected]>
I had assumed that if an event was running a sub and if the client
pressed a widget button which also called a sub that the subs would
execute in parallel. If it is actually that a button (-command) call would
actually have to wait for the event sub (if already running) to return, then
this would mean there is no need for what I am attempting.

My thougthts where was that I should get the program to exit gracefully
if a client hasn't responded to a program update notification (afk). I 
didn't
want to disconnect databases and call and exit if the user was in the middle
of running a subroutine associated to a widget he had pressed.

Hope that clears my question up a little.




Ala Qumsieh wrote:
> --- listmail <[email protected]> wrote:
>
>   
>> I have a top level widget event timer that calls a
>> sub routine 
>> periodically and does some checks. 
>>
>> I'd like to add some code, for specific reasons, to
>> be able to assess 
>> what other subroutines are currently being executed
>> with the mainloop.  
>> Is this possible?  I'd expect the call to always
>> indicate the event sub 
>> to be running so any additional subs is what I am
>> interested in.
>>     
>
> Not sure what you mean. Unless you're using threads,
> there is only one active subroutine at any one time.
> But, here's an idea. You can use global variables to
> track your progress. At the beginning of a subroutine,
> set the value of a specific var to 1. At the end set
> to 0. It's not pretty, but should be good 99% of the
> time.
>
> --Ala
>
>
>
>        
> ____________________________________________________________________________________
> TV dinner still cooling? 
> Check out "Tonight's Picks" on Yahoo! TV.
> http://tv.yahoo.com/
>
>   

--++**==--++**==--++**==--++**==--++**==--++**==--++**==
ptk mailing list
[email protected]
https://mailman.stanford.edu/mailman/listinfo/ptk