Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "David McClain" <dmcclain@azstarnet.com>
To: "Liste CAML" <caml-list@inria.fr>
Subject: Simple augmentation of reader allows MS Graphics...
Date: Sun, 14 Feb 1999 12:37:17 -0700	[thread overview]
Message-ID: <001901be5851$6f7ef8a0$210148bf@dylan> (raw)

It is well known that Win32 console mode I/O blocks the event loop for
graphics threads. A simple external augmentation of read() allows new OCAML
toplevels to perform Window Graphics, without recompiling or altering the
runtime system.

Microsoft has graciously named their I/O primitive "_read( )" so that we can
create our own "read( )" routine to intercept uses of it at link time,
substituting our own version that in turn calls the C runtime primitive
"_read( )" when it is more appropriate -- such as from another thread. This
allows up to pump message queues in the main thread, and to start up other
graphics threads without the problems normally encountered by a blocking
"read( )".

You can get some sample code at

    http://www.azstarnet.com/~dmcclain/graphics.cpp

This code includes the augmented "read( )" routine, a separate console
reader thread, and a separate graphics thread that puts up a simple window
with some imagery. This code can be compiled and used ahead of the C runtime
libraries in the link command of "ocamlmktop" to create new toplevels that
enable Win32 graphics.



David McClain
Sr. Scientist
Raytheon Missile Systems Co.
Tucson, AZ
http://www.azstarnet.com/~dmcclain/homepage.htm




                 reply	other threads:[~1999-02-14 22: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='001901be5851$6f7ef8a0$210148bf@dylan' \
    --to=dmcclain@azstarnet.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