caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Zheng Li <li@pps.jussieu.fr>
To: caml-list@inria.fr
Subject: Re: [ANN] coThreads 0.10
Date: Tue, 18 Sep 2007 15:40:52 +0200	[thread overview]
Message-ID: <87bqc06qhn.fsf@pps.jussieu.fr> (raw)
In-Reply-To: <87y7f473g1.fsf@pps.jussieu.fr>


Hi,

Thanks skaller for testing the fix on his machine. Here is a few updates:

 - I chose the simple fix: just restrict the upper bound of fresh_number
   based on the word_size of 32bit machine. It's only used to generate fresh
   number, name and offset, so I suspect the range is fairly enough. On the
   other hand, it won't be difficult to make use int64 and LargeFile for 64bit
   machine if necessary, but I'd better to get some x64 machine around for
   testing first.

 - A README for /example is added (also attached to the end of this post) 

 - Some minor updates to a few examples

 - I have no idea what's wrong with the sourceforge file download system. It
   did work when I uploaded the file a few days ago. Anyway, I re-uploaded the
   package (with the above modifications), hope it works.

Best regards.

-- 
Zheng Li
http://www.pps.jussieu.fr/~li


README for examples
===================

== BUILD ==

Just ''make all'' after you've got coThreads installed on your system.
Type ''make clean'' to remove all imtermediate and final building results.

== LIST ==

* coth (use: Thread (or Cothread), Mutex)
  Simple test of mutex. A set of threads tries to grab a single mutex and
  release it for random times 

* evt (use: Thread (or Cothread), Event)
  Simple test of event. Most examples are directly from the OCaml OReilly
  book. The execution won't exist, this is intentional.

* lock (use: Thread (or Cothread), Mutex)
  Simple test of mutex. A set of threads try to grab two mutex. Each thread
  first must grab the first mutex before the second mutex, then release the
  second mutex and the first one.

* mcast (use: Thread (or Cothread), Stm)
  STM example from [1], contributed by Yoriyuki Yamagata

* merge (use: Thread (or Cothread), Stm)
  STM example from [1], contributed by Yoriyuki Yamagata

* mvar (use: Thread (or Cothread), Stm)
  STM example from [1], contributed by Yoriyuki Yamagata

* phil (use: Thread (or Cothread), Stm)
  Classical philosophers dinning problem written in STM. Launch it with 
  [./phil n], where n is the number of philosophers and chopsticks.

* ray_col, ray_nocol (use: Cothread, Event)
  Replanted versions of Jon Harrop's ray tracer [3]. ray.ml is the module
  containing common computation functions, ray_xxx.ml are parallel engines.
  In ray_nocol.ml, the workers don't send the results back to master, instead
  they write them directly to the output file; in ray_col.ml, the workers send
  results back to the master, and the master write them to the output file. 
  Launch it with [./ray_xxx level size degree outputfile], where [level] and
  [size] are about the quality of output image, and [degree] is the parallel
  degree which should equal or greater than the cores or cpus of your machine
  if you'd like to get the most speedup. Or you may just lanch it with
  [./ray_xxx] which takes the default setting [./ray_xxx 9 512 2 ray_xxx.pgm]

* santa (use: Thread (or Cothread), Stm)
  The Santa Clause problem documented in [2]. The haskell version is attached
  as comment at the end of the file.

* sing (use: Thread (or Cothread), Stm)
  Simple test of Stm. Two threads constantly update a single tvar.

* test (use: Thread (or Cothread), Stm)
  Simple test of Stm to calculate the sum of [0..n-1] with n threads. The i_th
  thread is responsible for adding i to the sum. Its action is not allowed to
  take place until the current sum exceed sum (i/10).

* The Makefile itself is an example. It shows that how you can build your
  applications against a set of execution engines with just a few lines of
  pattern rules.

[1] http://research.microsoft.com/users/simonpj/papers/stm/index.htm#composble
[2] https://research.microsoft.com/users/simonpj/papers/stm/index.htm#beautiful
[3] http://www.ffconsultancy.com/languages/ray_tracer/index.html


Zheng Li <li@pps.jussieu.fr> writes:
> Thank you for the bug report. 
>
> Unfortunately I don't have a x64 machine to test, and know quite little about
> 64bit machine (that's why I made the mistake). 
>
> But the bug reason seems obvious: on a x64 machine, one have to use
> Unix.LargeFile.lseek to seek the address in the extra space. 
>
> On the other hand, I think 2^14 locks (the x86 case) are fairly enough in
> most situation. So we don't have to bother with Int64 and LargeFile. Could you
> (or anyone else with a x64 machine) help to test the simple solution: change
> "Sys.word_size - 2"  in the definition of "fresh_number" to 
> "(min Sys.word_size 32) - 2" as follows
>
> let fresh_number =
>   let usable_size = (min Sys.word_size 32) -2 in
>   let bits_of_id = 16 in (* Should be sufficient in most OS *)
>   ........
>
> and report whether it works? Thanks


  reply	other threads:[~2007-09-18 13:39 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-17 16:31 Zheng Li
2007-09-17 16:48 ` Zheng Li
2007-09-17 17:39   ` [Caml-list] " skaller
2007-09-17 17:51     ` Zheng Li
2007-09-17 21:33       ` [Caml-list] " skaller
2007-09-17 22:37         ` Zheng Li
2007-09-17 23:26           ` [Caml-list] " skaller
2007-09-18  0:16             ` Zheng Li
2007-09-18  0:53   ` [Caml-list] " Erik de Castro Lopo
2007-09-18  1:25     ` Erik de Castro Lopo
2007-09-18  4:29     ` skaller
2007-09-19 10:11   ` Erik de Castro Lopo
2007-09-19 10:58     ` Can coThreads be used for message passing architecture? Jan Kybic
2007-09-19 11:13       ` [Caml-list] " Erik de Castro Lopo
2007-09-19 12:59         ` Zheng Li
2007-09-20  4:16         ` [Caml-list] " Jon Harrop
2007-09-20  6:11           ` Erik de Castro Lopo
2007-09-20  9:06             ` Zheng Li
2007-09-20  8:49           ` Zheng Li
2007-09-19 19:13   ` [Caml-list] Re: [ANN] coThreads 0.10 Vu Ngoc San
2007-09-19 20:10     ` Zheng Li
2007-09-20  0:50       ` [Caml-list] " skaller
2007-09-20  4:29         ` Erik de Castro Lopo
2007-09-20  7:11           ` skaller
2007-09-20  7:52             ` Erik de Castro Lopo
2007-09-20  8:37               ` Zheng Li
2007-09-20 10:43                 ` [Caml-list] " skaller
2007-09-20 10:44                   ` Matthew Hannigan
2007-09-20 15:02                     ` skaller
2007-09-20 15:07                       ` Christophe Raffalli
2007-09-20 15:51                         ` skaller
2007-09-20 16:26                       ` Florian Weimer
2007-09-20 17:37                         ` Vincent Aravantinos
2007-09-21 16:33                       ` readline license (was: [ANN] coThreads 0.10) Xavier Leroy
2007-09-21 17:11                         ` [Caml-list] " Matthew William Cox
2007-09-21 18:05                         ` skaller
2007-09-21 21:51                           ` [Caml-list] Re: readline license Markus E L
2007-09-21 22:16                             ` Daniel Bünzli
2007-09-22  0:49                           ` [Caml-list] Re: readline license (was: [ANN] coThreads 0.10) Matthew Hannigan
2007-09-20 11:39                   ` [Caml-list] Re: [ANN] coThreads 0.10 Florian Weimer
2007-09-20 15:46                     ` skaller
2007-09-20 18:14                       ` Ken Rose
2007-09-20  8:31           ` Zheng Li
2007-09-20  8:18         ` Zheng Li
2007-09-18  2:10 ` [Caml-list] " Erik de Castro Lopo
2007-09-18  5:59   ` skaller
2007-09-18  6:23     ` Erik de Castro Lopo
2007-09-18  9:01       ` Zheng Li
2007-09-18 13:40         ` Zheng Li [this message]
2007-09-18 23:53           ` [Caml-list] " Erik de Castro Lopo
2007-09-18  9:09       ` [Caml-list] " skaller
2007-09-18 13:03       ` Markus E L

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=87bqc06qhn.fsf@pps.jussieu.fr \
    --to=li@pps.jussieu.fr \
    --cc=caml-list@inria.fr \
    /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).