* Threads vs. Fork
@ 2005-06-11 17:09 Jonathan T Bryant
2005-06-11 21:09 ` [Caml-list] " Eric Cooper
0 siblings, 1 reply; 2+ messages in thread
From: Jonathan T Bryant @ 2005-06-11 17:09 UTC (permalink / raw)
To: caml-list
The reason I asked about the threads is because I need the shared
memeory, but I also need to use multiple processors. Essentially, I'm
writing a mini-database. There's a shared data structure (a tree of
some description) and a bunch of workers that perform lookups. Every
time there's an update to the tree, all of the workers need to be
blocked until the update is completed (pretty standard stuff). I can
do this with fork if I can have shared memory, or I can do this with
threads if I can use multiple processors. Apparenly, neither option
exists in OCaml. Any suggestions on how to resolve this? Does
somebody have an extended Unix API that includes things like shared
memory (shmget(), shmat(), etc...)
--Jonathan
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Caml-list] Threads vs. Fork
2005-06-11 17:09 Threads vs. Fork Jonathan T Bryant
@ 2005-06-11 21:09 ` Eric Cooper
0 siblings, 0 replies; 2+ messages in thread
From: Eric Cooper @ 2005-06-11 21:09 UTC (permalink / raw)
To: caml-list
On Sat, Jun 11, 2005 at 01:09:54PM -0400, Jonathan T Bryant wrote:
> Does somebody have an extended Unix API that includes things like shared
> memory (shmget(), shmat(), etc...)
If you're willing to write a few C stubs, you can use the Bigarray internals to
access memory that you've set up via mmap().
--
Eric C. Cooper e c c @ c m u . e d u
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-06-12 3:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-11 17:09 Threads vs. Fork Jonathan T Bryant
2005-06-11 21:09 ` [Caml-list] " Eric Cooper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox