Ive been looking at POE wheel, which will make my job a lot easier and will give me a lot more power within Tk. however for the current setup I have I think using a timmer will be just as good (I only need to check a shared array every couple of seconds) Time HiRes (setitimer) will work fine.
with this however comes a complaint from my compiler that 'your vendor has not defined Time::HiRes macro ITIMER_VIRTUAL'with the following code taken from the HiRes example set
use Time::HiRes qw(tv_interval);
use Time::HiRes qw ( setitimer ITIMER_VIRTUAL time );
$SIG{VTALRM} = sub { print time, "\n" };
setitimer(ITIMER_VIRTUAL, 10, 2.5);
I am Running Active State Perl 5.88 build 819 on a XP, with HiRes 1.86
any pointers would be greatly apprenticed, however if HiRes will not run on my system I will rewrite with POE
thanks
Skywalker | [reply] [d/l] |
Maybe you need a different Time::HiRes module compiled for windows? I don't use MSWindows, but I have noticed there are sometimes multiple xs based versions of modules for MSWindows, and some work better on certain hardware/Windows-release combinations.
| [reply] |
Ok ive not managed to find any thing that will get my version of HiRes to function on Windows, or locate any specific Windows modules. however I have found a nice bit of code that I can use directly with Tk, that will run an interval check for me which until I rewrite using POE::Wheel will do me fine.
#start thread
$thr = threads->new(\&sub1);
#setup timer to process in 500ms intervals
$mw->repeat(500 => \&update_display);
MainLoop();
sub update_display{
print "Running from Mainloop\n";
$mw->update;
}
sub sub1{
while (1){
print "Running From thread\n";
sleep(1);
}
}
Thanks for all the help
Skywalker | [reply] [d/l] |