From: Brian Hurt <bhurt@janestcapital.com>
To: Jonathan Bryant <jtbryant@valdosta.edu>
Cc: Benedikt Grundmann <benedikt@cardexpert.net>, caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Faking concurrency using Unix forks and pipes (ray tracing results)
Date: Mon, 04 Jun 2007 14:00:57 -0400 [thread overview]
Message-ID: <46645359.80500@janestcapital.com> (raw)
In-Reply-To: <9BE9B524-35AA-43AC-8A63-4153E3AD672F@valdosta.edu>
Jonathan Bryant wrote:
>
> On Jun 4, 2007, at 12:33 PM, Benedikt Grundmann wrote:
>
>>
>> It looks a bit more complex, but that's just to avoid big strings in
>> case of big messages
>> (e.g. with the "simple" interface you end up with the "same" content
>> in memory twice).
>
>
> I think big strings are unavoidable in this case. They can be broken
> up at the protocol level for sending, but a large data structure is
> going to be marshaled into a big string. As far as same content in
> memory twice, that should be the case for pure values even in a
> regular OCaml program. As for mutable values, they shouldn't be sent
> over a channel to begin with. Once channels are available though,
> creating a synchronous mutable cell is only a few lines of code.
> (Check out Reppy's book/papers).
I'm wondering if inversion of control isn't an answer here. The idea is
to have a function of type buf_t -> string -> unit. Instead of building
up a giant string, the of_* functions would call this function on small
strings. Not unlike Buffers. But instead of building up in memory,
these function would fill a buffer and then send it off.
Brian
prev parent reply other threads:[~2007-06-04 18:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-04 10:56 Jon Harrop
2007-06-04 15:33 ` [Caml-list] " Jonathan Bryant
2007-06-04 15:39 ` Jonathan Bryant
[not found] ` <9b415f950706040850v586a285ax1448d23c0c78a375@mail.gmail.com>
2007-06-04 16:13 ` Jonathan Bryant
[not found] ` <9b415f950706040933r22e1560fhc088368ccb8444fa@mail.gmail.com>
2007-06-04 16:53 ` Jonathan Bryant
2007-06-04 18:00 ` Brian Hurt [this message]
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=46645359.80500@janestcapital.com \
--to=bhurt@janestcapital.com \
--cc=benedikt@cardexpert.net \
--cc=caml-list@yquem.inria.fr \
--cc=jtbryant@valdosta.edu \
/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