caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Serge Sivkov <ssp.mryau@gmail.com>
To: Gerd Stolpmann <gerd@gerd-stolpmann.de>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] netplex multi-thread asynchronous processor for  passive clients
Date: Fri, 3 Apr 2009 23:55:00 +0600	[thread overview]
Message-ID: <c6c39ebb0904031055h7960e7fcs1d827f4c5ee92621@mail.gmail.com> (raw)
In-Reply-To: <1238773897.9723.6.camel@flake.lan.gerd-stolpmann.de>

Hello,

I 've look through sources of the netplex. For now i clearly see how
synchronious service works,
but i don't understand workflow of anyncronious version of netplex
services (i'm using ocamlnet-2.2.9). As says manual, to implement
anync version of the processor i must to return control to container
right away as first message is sent and don't call when_done.
At that moment, container calls #setup_polling, but i don't understand
how this code may jumps back to #process?

Does services started from one Netplex_main.startup are share same
event system for case
where their workload_manager sections in configuration file are identical?

I've written some code, but it doesn't works :(

exception DataArrived

(* from #process of the receiver service i call *)
container#event_system#add_event (Extra DataArrived)

(* and in #process of the sender i doing something like *)
let g = container#event_system#new_group in
container#event_system#add_handler g (fun _ _ evt -> output_string ch
"...\n"; flush ch)

but no one event has been detected in sender service...
Where i'm wrong?

>> That code doesn't work because method process called from
>> receive_admin_message got wrong fd as argument (i assume, that's
>> parent fd used to accept right one).
>
> No, that does not work. process must be called from the right
> environment.
>
>> What is the right way to write porcessor which must:
>>  - work asyncroniously with multithread workload manager
>>    (ideally, many jobs per thread)
>>  - work with clients whom don't send any packets
>> - get data to send from messages sent by other service
>
> e.g. open a Unix domain socket, and send data over that socket. Right
> now, there is no faster way that is officially supported. For
> convenience, you can define RPC procedures that do all the serialization
> details.
>
> What could work if sender and receiver are on the same event system: The
> sender puts a special event with the message onto the event queue, and
> the receiver installs an event handler listening for such events. I
> don't have demo code for something like this, however.


  reply	other threads:[~2009-04-03 17:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-03 11:19 Serge Sivkov
2009-04-03 15:51 ` [Caml-list] " Gerd Stolpmann
2009-04-03 17:55   ` Serge Sivkov [this message]
2009-04-03 18:13     ` Jake Donham
2009-04-04 14:24     ` Serge Sivkov
2009-04-05 16:27       ` Serge Sivkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c6c39ebb0904031055h7960e7fcs1d827f4c5ee92621@mail.gmail.com \
    --to=ssp.mryau@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=gerd@gerd-stolpmann.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).