Re: alarm function under while loop

2012-08-25 Thread Rocco Caputo
Hi, Gokul.

POE::Kernel-alarm() enqueues an alarm, but it is not like the built-in 
alarm().  POE's alarms are dispatched by POE::Kernel in between callbacks.  
Your while() loop pre-empts the dispatcher, so the enqueued alarms never occur.

If your program must delay there, you can use POE::Kernel-run_while() to run 
POE's dispatcher while a variable is true.  Set the variable false from the 
callback you are waiting for.

-- 
Rocco Caputo rcap...@pobox.com

On Aug 22, 2012, at 05:54, Gokul Prasad wrote:

 Hi,
 
 Am setting alarm in calling a function to check if particular task
 has executed properly or what.
 
 when i place the below code under while loop this alarm function is
 not being called, but when i comment while loop, it is just works fine
 correctly.
 
 while(end_time = current_time){
 $heap-{next_alarm_time} = int(time())+30;
print STDERR $heap-{next_alarm_time} why ti is printing\n;
 $kernel-alarm(next_task =
 $heap-{next_alarm_time});#$heap-{RESULT}-{event});
 }
 Not sure why it is happening? any suggestion.please
 
 
 Regards,
 gokul



Re: POE process getting too busy

2012-08-25 Thread Rocco Caputo
Since this problem is platform-specific, the best I can manage without access 
to the machine is advice.

Web searches imply that Solaris may be broken, the program may have run out of 
file descriptors, an OS upgrade may have broken compatibility with an older 
build of Perl, or some other issue:

https://community.emc.com/thread/111914
http://dbaspot.com/solaris/242660-high-cpu-utilization-solaris-10-a.html
http://www.mail-archive.com/dovecot@dovecot.org/msg04283.html
http://developerweb.net/viewtopic.php?id=5481
http://www.symantec.com/business/support/index?page=contentpmv=printimpressions=viewlocale=id=TECH163245
http://wesunsolve.net/bugid/id/6404383

-- 
Rocco Caputo rcap...@pobox.com

On Aug 21, 2012, at 06:09, Markus Jansen wrote:

 Hi,
 
 thanks a lot for the immediate answer, I also changed the code immediately, 
 and started another long-term test run.
 Just found the process 99% busy again - the good news is that the signal pipe 
 does not seem to be the culprit :-).
 
 Any other suggestions are highly welcome ...
 
 Thanks  best regards,
   Markus
 
 -Original Message-
 From: Tod McQuillin [mailto:de...@spamcop.net] 
 Sent: den 16 augusti 2012 02:46
 To: Markus Jansen
 Cc: poe@perl.org
 Subject: Re: POE process getting too busy
 
 On Wed, 15 Aug 2012, Markus Jansen wrote:
 
 I have discovered an annoying phenomenon, where after some while 
 (days, weeks) a process (which is part of a multi-server POE network) all of 
 a sudden goes berzerk by using all resources of its CPU.
 The good news is that the process itself remains fully functional, but from 
 a system usage/load perspective, the situation is quite intolerable.
 
 This sounds very familiar to me.
 
 I encountered a similar problem on solaris and was able to make it stop by 
 putting the following line of code at the beginning of my POE program:
 
 BEGIN { eval sub POE::Kernel::USE_SIGNAL_PIPE () { 0 } }
 
 There seems to be a problem with the signal pipe on some platforms, but I 
 haven't yet done more research to track down what's going wrong.
 --
 Tod