caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Threads in byte code and native code work differently
@ 2014-09-25 10:26 Kakadu
  2014-09-25 11:19 ` Török Edwin
  0 siblings, 1 reply; 3+ messages in thread
From: Kakadu @ 2014-09-25 10:26 UTC (permalink / raw)
  To: Caml List

Hello,

I have demo application [1] which creates OCaml threads and executes
C++ event loop from different libraries. When I compile it to native
code everything is fine but when I create custom bytecode executable
OCaml threads doesn't work.

I have tested it with Qt4, Qt5 and GTK2 and behaviour is same. Can you
explain me what is happening there, please

My OCaml version is 4.01.0


Kind regards,
Kakadu

[1] https://github.com/Kakadu/ocaml-trik/tree/desktop

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Threads in byte code and native code work differently
  2014-09-25 10:26 [Caml-list] Threads in byte code and native code work differently Kakadu
@ 2014-09-25 11:19 ` Török Edwin
  2014-09-25 12:17   ` Gerd Stolpmann
  0 siblings, 1 reply; 3+ messages in thread
From: Török Edwin @ 2014-09-25 11:19 UTC (permalink / raw)
  To: caml-list

On 09/25/2014 01:26 PM, Kakadu wrote:
> Hello,
> 
> I have demo application [1] which creates OCaml threads and executes
> C++ event loop from different libraries. When I compile it to native
> code everything is fine but when I create custom bytecode executable
> OCaml threads doesn't work.
> 
> I have tested it with Qt4, Qt5 and GTK2 and behaviour is same. Can you
> explain me what is happening there, please

See https://sympa.inria.fr/sympa/arc/caml-list/2004-07/msg00305.html
If you use '-vmthread' the runtime doesn't create new system threads for you.

Is there a particular reason why you need to use 'ocamlc -vmthread' instead of 'ocamlc -thread'?

Best regards,
--Edwin




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Threads in byte code and native code work differently
  2014-09-25 11:19 ` Török Edwin
@ 2014-09-25 12:17   ` Gerd Stolpmann
  0 siblings, 0 replies; 3+ messages in thread
From: Gerd Stolpmann @ 2014-09-25 12:17 UTC (permalink / raw)
  To: Török Edwin; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 1316 bytes --]

Am Donnerstag, den 25.09.2014, 14:19 +0300 schrieb Török Edwin:
> On 09/25/2014 01:26 PM, Kakadu wrote:
> > Hello,
> > 
> > I have demo application [1] which creates OCaml threads and executes
> > C++ event loop from different libraries. When I compile it to native
> > code everything is fine but when I create custom bytecode executable
> > OCaml threads doesn't work.
> > 
> > I have tested it with Qt4, Qt5 and GTK2 and behaviour is same. Can you
> > explain me what is happening there, please
> 
> See https://sympa.inria.fr/sympa/arc/caml-list/2004-07/msg00305.html
> If you use '-vmthread' the runtime doesn't create new system threads for you.
> 
> Is there a particular reason why you need to use 'ocamlc -vmthread' instead of 'ocamlc -thread'?

Maybe Kakadu did not know this: you can also use -thread for bytecode.
In ancient versions of OCaml this was not possible, but this mode has
been enabled for a long time now.

Gerd
-- 
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
My OCaml site:          http://www.camlcity.org
Contact details:        http://www.camlcity.org/contact.html
Company homepage:       http://www.gerd-stolpmann.de
------------------------------------------------------------

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-25 12:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-25 10:26 [Caml-list] Threads in byte code and native code work differently Kakadu
2014-09-25 11:19 ` Török Edwin
2014-09-25 12:17   ` Gerd Stolpmann

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).