Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Kakadu <kakadu.hafanana@gmail.com>
To: Caml List <caml-list@inria.fr>
Subject: [Caml-list] React wrappers for C++ code and OCaml threads
Date: Tue, 9 Dec 2014 20:31:57 +0300	[thread overview]
Message-ID: <CAGmVoG2gyuDeqAfSnHtdyFos5Yg-CODwcRPGkMTB3Soh3pe+PQ@mail.gmail.com> (raw)

Hello,

I have a C++ code and OCaml one in the same application. Ocaml will
spawn many OCaml threads. Also I have global C++ object with a number
of fields and I want to catch when these fields' values are changing.
On every change I want to emit ocaml-react signal associated with a
field. OCaml threads will subscribe to signals and do some work after
receiving them.

So, the whole app is going to have these threads:
1) C++ thread with Qt event loop
2) OCaml thread with event loop which will monitor changes in global
C++ object. Also it will emit OCaml-react signals
3) Many OCaml worker threads which will do something useful.

This design is a little bit scary for me. Will it work and can I do
something better without abandoning C++ code? Have you ever wrapped
C++ objects into OCaml event like I need?

Kind regards,
Kakadu


P.S. My C++ object doesn't have Qt properties with Qt signals, it has
only fields. And that
s why I need another event loop.

                 reply	other threads:[~2014-12-09 17:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CAGmVoG2gyuDeqAfSnHtdyFos5Yg-CODwcRPGkMTB3Soh3pe+PQ@mail.gmail.com \
    --to=kakadu.hafanana@gmail.com \
    --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