develooper Front page | perl.perl5.porters | Postings from February 2012

Re: [perl #108470] Term::ReadLine should use AE instead of Tkforevent looping

Thread Previous | Thread Next
From:
Marc Lehmann
Date:
February 2, 2012 11:29
Subject:
Re: [perl #108470] Term::ReadLine should use AE instead of Tkforevent looping
Message ID:
20120202192942.GB6672@schmorp.de
On Thu, Feb 02, 2012 at 03:51:21PM +0000, Paul LeoNerd Evans <leonerd@leonerd.org.uk> wrote:
> > If there are newer versions of IO::Async::Loop::AnyEvent that happen to
> > work (which would require some changes to IO::Async, which is an event
> > library, so can't sit on top of anyevent and work at the same time), then
> > it's easy to remove this check, or indeed override the check itself, after
> > all, IO::Async::Loop::AnyEvent didn't shy back from hacking internals
> > before, so nothing really changed.
> 
> Again, I believe all that's required on AnyEvent's side is to provide
> such a behaviour. Perhaps it could be documented as the following:

Anyevent does not and cnanot implement anything like that. If you think
peeking into internals gives you that, you are wrong.

The problem with IO::Async::Loop::AnyEvent is that it breaks the contract
that AnyEvent provides (namely offering events) for _all_ other modules,
by blocking when it shouldn't.

This lead to bug reports against anyevent because programs froze, or ended up
using 100% cpu when they shouldn't and didn't make any progress.

Since these problems are hard to diagnose, I added a diagnostics.

> I would be happy to write unit tests, documentation, etc... if you'd
> accept a patch.

If you think it can be implemented, feel free. But it can't, because most
event loops do not offer the required functionality.

> Once that is in I would be happy to rewrite IO::Async::Loop::AnyEvent to
> only use this published API and no longer abuse internals.

The internals abuse is not and was not the real problem - the problem is
that it breaks the semantics of anyevent for everybody, and it's simply
designed at the wrong level.

The only way to fix it, as I have explained to you multiple times, is to
make IO::Async use AnyEvent (by whichever means) and provide a proper
IO::Async loop module that AnyEvent can rely on, and make IO::Async
event-based instead of blocking. That's the only way to fix it.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp@schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About