[poe-commits] poe/POE/Kernel Tk.pm,1.23,1.24 Event.pm,1.16,1.17
Brought to you by:
rcaputo
From: <rc...@us...> - 2002-07-09 21:14:50
|
Update of /cvsroot/poe/poe/POE/Kernel In directory usw-pr-cvs1:/tmp/cvs-serv23918/POE/Kernel Modified Files: Tk.pm Event.pm Log Message: Randal Schwartz discovered a problem in POE::Kernel::Event where it would not permit an idle program to shut down. It turned out that an optimization in Kernel garbage collection prevented GC from being tested if there were events in the queue. Newer SIGCHLD polling keeps at least one event in the queue at all times, so GC was never being tweaked. It turns out that POE::Kernel::Tk has the same problem. These beg the question: How were the tests ever working? Note: It might be better to differentiate between Kernel's events and Sessions' events, and force GC when Sessions' count reached 0. Index: Tk.pm =================================================================== RCS file: /cvsroot/poe/poe/POE/Kernel/Tk.pm,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Tk.pm 25 Jun 2002 07:12:15 -0000 1.23 --- Tk.pm 9 Jul 2002 21:14:48 -0000 1.24 *************** *** 299,302 **** --- 299,312 ---- ], ); + + # POE::Kernel's signal polling loop always keeps oe event in the + # queue. We test for an idle kernel if the queue holds only one + # event. A more generic method would be to keep counts of user + # vs. kernel events, and GC the kernel when the user events drop + # to 0. + + if (@kr_events == 1) { + {% test_for_idle_poe_kernel %} + } } Index: Event.pm =================================================================== RCS file: /cvsroot/poe/poe/POE/Kernel/Event.pm,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Event.pm 29 May 2002 05:24:10 -0000 1.16 --- Event.pm 9 Jul 2002 21:14:48 -0000 1.17 *************** *** 187,190 **** --- 187,200 ---- $self->[KR_WATCHER_TIMER]->at( $kr_events[0]->[ST_TIME] ); $self->[KR_WATCHER_TIMER]->start(); + + # POE::Kernel's signal polling loop always keeps oe event in the + # queue. We test for an idle kernel if the queue holds only one + # event. A more generic method would be to keep counts of user + # vs. kernel events, and GC the kernel when the user events drop + # to 0. + + if (@kr_events == 1) { + {% test_for_idle_poe_kernel %} + } } |