Concurrency and AnyEvent::MPRPC

Tobias Nissen tn at movb.de
Fri Sep 16 15:39:38 CEST 2011


Marc Lehmann wrote:
> On Tue, Sep 13, 2011 at 06:13:41PM +0200, Tobias Nissen <tn at movb.de>
> wrote:
[...]
>> I'd like to know if there are arguments against the way I'm doing it
>> right now. Can you think of problems that might arise using AnyEvent
>> with ForkManager like this?
> 
> Apart from likely very bad performance with EV+epoll (forcing select
> might fix that), not really. You have to make sure to not initialise
> AnyEvent in the parent if you want to use AnyEvent in the child, of
> course, or nt use AnyEvent in the child when using it in the parent.

Do you mean "use" as in Perl's "use AnyEvent;"? I uploaded my test code
to

  http://movb.de/redmine/projects/test1/repository

The server setup is in

  http://movb.de/redmine/projects/test1/repository/entry/server.pl

Registration of the MPRPC callbacks happens in

  http://movb.de/redmine/projects/test1/repository/entry/Loki/MPRPCRegistrar.pm

A sample callback is in

  http://movb.de/redmine/projects/test1/repository/entry/Loki/MPRPC/Foo.pm

The registration happens before forking the children (line 19 in
server.pl), so everything is already set up and nothing more has to be
initialized; is that OK then?


______
P.S.: Your mail to me CC'ed the mailing list, but I received it only
once -- did my mail server remove the duplicate or was there some other
error?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.schmorp.de/pipermail/anyevent/attachments/20110916/05dae7ed/attachment.pgp>


More information about the anyevent mailing list