ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/lib/AnyEvent/Impl/POE.pm
(Generate patch)

Comparing AnyEvent/lib/AnyEvent/Impl/POE.pm (file contents):
Revision 1.10 by root, Fri Apr 25 04:34:30 2008 UTC vs.
Revision 1.11 by root, Fri Apr 25 04:55:59 2008 UTC

66 66
67=item Timing Deficiencies 67=item Timing Deficiencies
68 68
69POE manages to not have a function that returns the current time. This is 69POE manages to not have a function that returns the current time. This is
70extremely problematic, as POE can use different time functions, which can 70extremely problematic, as POE can use different time functions, which can
71differ by more than a second. In addition, most timer functions in POE 71differ by more than a second - and user code is left guessing which one is
72want an absoltue timestamp, which is hard to create if all you have is a 72used.
73relative time and no function to return the "current time". 73
74In addition, most timer functions in POE want an absoltue timestamp, which
75is hard to create if all you have is a relative time and no function to
76return the "current time".
74 77
75AnyEvent works around this by using relative timer fucntions, in the hope 78AnyEvent works around this by using relative timer fucntions, in the hope
76that POE gets it right at least internally. 79that POE gets it right at least internally.
77 80
78=item Event Non-Ordering 81=item Event Non-Ordering
85 88
86=item Child Watchers 89=item Child Watchers
87 90
88POE offers child watchers - which is a laudable thing, as few event loops 91POE offers child watchers - which is a laudable thing, as few event loops
89do. Unfortunately, they cannot even implement AnyEvent's simple child 92do. Unfortunately, they cannot even implement AnyEvent's simple child
90watchers: they are not generic enough. 93watchers: they are not generic enough (even the POE implementation itself
94isn't generic enough to let properly designed event loops such as EV use
95their child watcher instead - it insist on doing it itself the slow way).
91 96
92Of course, if POE reaps an unrelated child it will also output a message 97Of course, if POE reaps an unrelated child it will also output a message
98for it that you cannot suppress (which shouldn't be too surprising at this
93for it. Very professional. 99point). Very professional.
94 100
95As a workaround, AnyEvent::Impl::POE will take advantage of undocumented 101As a workaround, AnyEvent::Impl::POE will take advantage of undocumented
96behaviour in POE::Kernel to catch the status fo all child processes. 102behaviour in POE::Kernel to catch the status of all child processes.
97 103
98Unfortunately, POE's child handling is racy: if the child exits before the 104Unfortunately, POE's child handling is racy: if the child exits before the
99handler is created (which is impossible to guarantee...), one has to wait 105handler is created (which is impossible to guarantee...), one has to wait
100for another event to occur, which can take an indefinite time (apparently 106for another event to occur, which can take an indefinite time (apparently
101POE does a busy-waiting loop every second, but this is not guarenteed 107POE does a busy-waiting loop every second, but this is not guarenteed
129 coredump. These are: HUP, INT, QUIT and TERM. 135 coredump. These are: HUP, INT, QUIT and TERM.
130 136
131Although AnyEvent calls C<sig_handled>, removing it has no apparent 137Although AnyEvent calls C<sig_handled>, removing it has no apparent
132effects on POE handling SIGINT. 138effects on POE handling SIGINT.
133 139
140 refcount_increment SESSION_ID, COUNTER_NAME
141
142Nowhere is explained which COUNTER_NAMEs are valid and which aren't - not
143all scalars (or even strings) are valid counter names. Take your guess,
144failure is of course completely silent.
145
146 get_next_event_time() returns the time the next event is due, in a form
147 compatible with the UNIX time() function.
148
149And surely, one would hope that POE supports subsecond accuracy as
150documented elsewhere, unlike the explanation above implies. Yet:
151
152 POE::Kernel timers support subsecond accuracy, but don’t expect too
153 much here. Perl is not the right language for realtime programming.
154
155... of course, Perl is not the right language to expect subsecond accuray
156- the manpage author must hate Perl to spread so much FUD in so little
157space. The Deliantra game server logs with 100µs-accuracy because Perl is
158fast enough to require this, and is still able to deliver map updates with
159little jitter at exactly the right time. It does not, however, use POE.
160
134 Furthermore, since the Kernel keeps track of everything sessions do, it 161 Furthermore, since the Kernel keeps track of everything sessions do, it
135 knows when a session has run out of tasks to perform. 162 knows when a session has run out of tasks to perform.
136 163
137This is impossible - how does the kernel now that a session is no longer 164This is impossible - how does the kernel know that a session is no longer
138watching for some (external) event (e.g. by some other session)? It 165watching for some (external) event (e.g. by some other session)? It
139cannot, and therefore this is wrong - but you would be hard pressed to 166cannot, and therefore this is wrong - but you would be hard pressed to
140find out how to work around this and tell the kernel manually about such 167find out how to work around this and tell the kernel manually about such
141events. 168events.
142 169

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines