From: Rob Browning <rlb@defaultvalue.org>
Cc: guile-devel@gnu.org
Subject: Re: GH replacement proposal (includes a bit of Unicode)
Date: Wed, 21 Apr 2004 23:39:00 -0500 [thread overview]
Message-ID: <877jw87hjv.fsf@trouble.defaultvalue.org> (raw)
In-Reply-To: <ljsmfgvt7t.fsf@troy.dt.e-technik.uni-dortmund.de> (Marius Vollmer's message of "Wed, 07 Apr 2004 15:00:06 +0200")
Marius Vollmer <marius.vollmer@uni-dortmund.de> writes:
> Hi,
>
> I have a partial proposal for making type conversions between Scheme
> and C easier.
Overall, I like it, and most of the comments I thought of have already
been covered by Paul, Dirk, and others.
> These two functions lock and unlock all SCM objects (the heap). The
> heap should not be locked for long periods of time and no calls to
> 'normal' libguile functions are allowed while it is locked. A
> function is 'normal' unless it is specifically documented to be
> useable with a locked heap. (Indeed, most 'unnormal' functions can
> _only_ be used while the heap is locked.)
>
> You can not lock the heap twice. Calling scm_lock_heap while the
> heap is already locked results in undefined behavior. Likewise,
> calling scm_unlock_heap when the heap is not locked is verboten.
>
> - const unsigned char *scm_l_get_utf8_string_mem (SCM str);
I'm a little wary of the locking, especially global locking, but I
suppose it may well be necessary. I don't have a strong feeling
either way offhand, but presuming for the moment that it is necessary,
then is there any way to lock down a particular value rather than the
entire heap? Also, could and should we make it easy to install a
frame unwind handler that unlocks the heap when acquiring the lock?
Finally, what's the argument against allowing recursive locking by the
same thread, too expensive?
On a related note, in many cases, I suspect all the user may really
need is a cheap way to copy some offset + size chunk of the data into
their own buffer, especially when dealing with homogeneous uint8
arrays. If so, then it might make sense to provide a set of functions
that can do that, handling whatever locking and memcpying is needed.
--
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2004-04-22 4:39 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-07 13:00 GH replacement proposal (includes a bit of Unicode) Marius Vollmer
2004-04-07 15:04 ` Paul Jarc
2004-04-13 13:25 ` Marius Vollmer
2004-04-13 15:54 ` Paul Jarc
2004-04-21 15:08 ` Marius Vollmer
2004-04-21 16:10 ` Paul Jarc
2004-04-21 18:06 ` Marius Vollmer
2004-04-21 16:31 ` Delivery failure (guile-devel@gnu.org) Bruce Korb
2004-04-21 21:34 ` GH replacement proposal (includes a bit of Unicode) Marius Vollmer
2004-04-21 21:46 ` Paul Jarc
2004-04-21 22:19 ` Dale P. Smith
2004-04-21 22:34 ` Paul Jarc
2004-04-21 23:02 ` Kevin Ryde
2004-04-22 17:36 ` Dirk Herrmann
2004-04-22 18:31 ` Paul Jarc
2004-05-17 21:14 ` Marius Vollmer
2004-05-17 21:57 ` Bruce Korb
2004-05-18 9:54 ` Marius Vollmer
2004-04-22 17:00 ` Dirk Herrmann
2004-04-24 10:06 ` Dirk Herrmann
2004-04-24 19:46 ` Marius Vollmer
2004-04-25 20:33 ` Dirk Herrmann
2004-04-25 21:38 ` Paul Jarc
2004-05-17 21:45 ` Marius Vollmer
2004-04-17 13:21 ` Dirk Herrmann
2004-04-22 4:16 ` Rob Browning
2004-04-22 17:48 ` Dirk Herrmann
2004-05-12 20:09 ` Marius Vollmer
2004-05-15 9:50 ` Dirk Herrmann
2004-05-24 18:51 ` Marius Vollmer
2004-05-25 0:21 ` Paul Jarc
2004-05-26 21:27 ` Dirk Herrmann
2004-06-03 21:40 ` Marius Vollmer
2004-06-04 6:52 ` tomas
2004-08-09 22:29 ` Marius Vollmer
2004-05-15 10:18 ` Dirk Herrmann
2004-05-24 19:36 ` Marius Vollmer
2004-05-26 22:11 ` Dirk Herrmann
2004-08-09 22:28 ` Marius Vollmer
2004-04-22 4:39 ` Rob Browning [this message]
2004-04-22 17:58 ` Dirk Herrmann
2004-04-23 0:25 ` Rob Browning
2004-04-23 16:57 ` Marius Vollmer
2004-04-23 17:16 ` Rob Browning
2004-05-17 21:24 ` Marius Vollmer
2004-04-23 17:36 ` Andreas Rottmann
2004-05-17 21:30 ` Marius Vollmer
2004-05-18 9:21 ` Andreas Rottmann
2004-04-25 7:54 ` Dirk Herrmann
2004-05-17 21:44 ` Marius Vollmer
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
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877jw87hjv.fsf@trouble.defaultvalue.org \
--to=rlb@defaultvalue.org \
--cc=guile-devel@gnu.org \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).