9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: forsyth@caldo.demon.co.uk forsyth@caldo.demon.co.uk
Subject: [9fans] Porting XaoS (saga continues)
Date: Tue,  9 Sep 1997 07:39:39 +0100	[thread overview]
Message-ID: <19970909063939.N9BTNgRaVfGtFk_KHR-T4UmDS9cNyY7O_g0NU_3Ns_Y@z> (raw)

see /sys/src/cmd/disk/kfs/libp/port/qlock.c and related
files for a user-level QLock and RWLockimplementation.  you should
be able to implementat what you need with that.  note too that
sleep(0) will relinquish the CPU.  see /sys/src/cmd/exportfs
and /sys/src/cmd/telco for other examples of multi-process
servers and different approaches to synchronisation.
you'll also find a concurrency-safe version of
malloc.c in at least one of those directories.

most new concurrent programs in Plan 9 are (best)
written in Alef, so not much effort has gone into providing
a complete programming package for the venerable C.

one point that's easy to overlook is that fork(2) notes that rfork(RFPROC|RFMEM)
causes ALL subsequent forks to share data.  consequently, you need to ensure that
einit(...) is called to initialise the graphics event code before you do
the first RFMEM rfork, otherwise things can get a little bit confused.

as to the second question, i'm afraid that Plan 9 graphics supports only
up to 8 bits (0 <= Bitmap.ldepth <= 3).  it's not just 8½; it would require
a fair amount of effort to change.




             reply	other threads:[~1997-09-09  6:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-09  6:39 forsyth [this message]
1997-09-09  8:28 Jan
1997-09-10  8:53 Jan
1997-09-10 15:40 Tom
1997-09-11  8:32 Jan

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=19970909063939.N9BTNgRaVfGtFk_KHR-T4UmDS9cNyY7O_g0NU_3Ns_Y@z \
    --to=forsyth@caldo.demon.co.uk \
    /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).