From: Shivkumar Chandrasekaran <shiv@ece.ucsb.edu>
To: caml-list@inria.fr
Subject: Re: [Caml-list] native threads not parallel?
Date: Mon, 24 Feb 2003 09:39:50 -0800 [thread overview]
Message-ID: <F96B1E64-481E-11D7-AF4A-000393942C76@ece.ucsb.edu> (raw)
In-Reply-To: <20030222001142G.garrigue@kurims.kyoto-u.ac.jp>
This seems to match the observed behavior on my machine. I could infer
that the two threads were being executed in parallel; just not on
different processors simultaneously. Thank you very much!!
On Friday, February 21, 2003, at 07:11 AM, Jacques Garrigue wrote:
> I see, after rereading carefully the original mail, I could understand
> what this is about.
>
> IIRC, the distinction is not between native code and bytecode, but
> between native threads and caml threads. You can use native threads in
> bytecode, and it should work also (but I might be wrong).
>
> About the problem Markus is describing, and if he is using
> Thread.create as you suggest, I may see a cause. Seeing that the code
> for caml_thread_new in posix.c contains no enter_blocking_section, if
> you create a thread with Thread.create, it will immediately block
> trying to get the caml mutex. It will get it eventually from the main
> caml thread through a yield, but a clever scheduler will schedule this
> thread on the same processor (it starts just when the previous one
> stops). As Markus says, after a long time the scheduler may realize
> this choice was wrong and change the processor, but this is scheduler
> dependent.
>
> I may be utterly wrong in my inference, but if this is right, a better
> solution would be to explicitely start the thread with pthread_start
> from the C side.
>
> Jacques Garrigue
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr Archives:
> http://caml.inria.fr
> Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ:
> http://caml.inria.fr/FAQ/
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>
--shiv--
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
next prev parent reply other threads:[~2003-02-24 17:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-20 23:10 Shivkumar Chandrasekaran
2003-02-21 0:15 ` Jacques Garrigue
2003-02-21 4:24 ` shivkumar chandrasekaran
2003-02-21 10:43 ` Markus Mottl
2003-02-21 15:11 ` Jacques Garrigue
2003-02-21 17:57 ` Markus Mottl
2003-02-24 17:39 ` Shivkumar Chandrasekaran [this message]
2003-02-21 0:32 ` Chris Uzdavinis
2003-02-21 1:56 ` james woodyatt
2003-02-21 4:43 ` shivkumar chandrasekaran
-- strict thread matches above, loose matches on Subject: below --
2001-06-15 16:49 Markus Mottl
2001-06-15 17:10 ` Xavier Leroy
2001-06-15 18:42 ` Markus Mottl
2001-06-15 21:33 ` Markus Mottl
2001-06-21 13:43 ` Markus Mottl
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=F96B1E64-481E-11D7-AF4A-000393942C76@ece.ucsb.edu \
--to=shiv@ece.ucsb.edu \
--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).