From: Richard Jones <rich@annexia.org>
To: Dmitry Bely <dmitry.bely@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Can GC be BLOCKed?
Date: Sat, 2 Dec 2006 11:19:04 +0000 [thread overview]
Message-ID: <20061202111904.GA16137@furbychan.cocan.org> (raw)
In-Reply-To: <90823c940612010539vacb2ffasf4e90748ef1c0485@mail.gmail.com>
On Fri, Dec 01, 2006 at 04:39:26PM +0300, Dmitry Bely wrote:
> On 12/1/06, Richard Jones <rich@annexia.org> wrote:
>
> >I've only seen two cases where I'd want to stop the GC from running:
> >(1) During quasi real-time operations (eg. a single frame in a game) --
> >this can be solved by making the heap large enough and running the GC
> >at scheduled points. (2) When the heap is larger than physical RAM --
> >this is solved using our 'Ancient' module.
>
> I have a main program in C that periodically calls an OCaml function
> and expects the (near) real time response. So I'd like to avoid gc
> inside that function. My current plan is to have another OCaml thread
> that is unfrozen just before returning results to C and does the minor
> (or major - how to decide which one?) garbage collection. Will it
> work?
I guess it'll work - the thing to do is to try it. I'm wondering why
you need a real time response, and I also hope you're avoiding any
sort of memory allocation on the C side, because malloc and free are
hardly real time functions either. Many C programmers seem to treat
them as if they were O(1) operations though.
Rich.
--
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Internet Marketing and AdWords courses - http://merjis.com/courses - NEW!
Merjis blog - http://blog.merjis.com - NEW!
next prev parent reply other threads:[~2006-12-02 11:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-30 0:33 Neal Wang
2006-11-30 3:07 ` [Caml-list] " James Woodyatt
2006-12-01 0:07 ` Neal Wang
2006-12-01 0:38 ` Tom
2006-12-01 9:19 ` Richard Jones
2006-12-01 13:39 ` Dmitry Bely
2006-12-01 23:28 ` Philippe Wang
2006-12-02 10:04 ` Dmitry Bely
2006-12-02 12:14 ` Philippe Wang
2006-12-02 11:19 ` Richard Jones [this message]
2006-12-01 18:53 ` Neal Wang
2006-12-01 19:13 ` Chris King
2006-12-04 9:37 ` Hendrik Tews
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=20061202111904.GA16137@furbychan.cocan.org \
--to=rich@annexia.org \
--cc=caml-list@inria.fr \
--cc=dmitry.bely@gmail.com \
/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).