unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Panicz Maciej Godek <godek.maciek@gmail.com>
To: Chris Vine <chris@cvine.freeserve.co.uk>
Cc: "guile-user@gnu.org" <guile-user@gnu.org>
Subject: Re: libguile thread safety
Date: Sat, 4 Jan 2014 23:43:22 +0100	[thread overview]
Message-ID: <CAMFYt2ZrabqvoLeSD8kaZBQu9Ne1XFcFf3e-gSBq=yrP+Eauvg@mail.gmail.com> (raw)
In-Reply-To: <20140104210118.3564073f@bother.homenet>

2014/1/4 Chris Vine <chris@cvine.freeserve.co.uk>:
> Is it efficiency concerns that make you think it unusual, or just that the
> use case is unusual?

I don't think that creating a new module is particularly inefficient,
and it would only become noticable if you were creating many many
threads with a short lifetime. What's unusual (and I think that Mark
would agree) is that you'd normally want your thread to be able to
access all the definitions that are visible to the program (or: to the
main thread). If a program is written in a functional style, the
threads usually don't mutate their global environment -- they just
read the definitions -- so any race conditions or other conflicts are
unlikely.

I think that your use-case is different and that you make very few
assumptions on the code that the threads will execute -- in
particular, that it might be a highly imperative code which does
mutate its global state. If it is so, then I think that this is the
right way. (Be warned, that it doesn't protect the system from
malicious code -- it is still possible for a thread to modify the
content of another module, but it's difficult to do that by accident)

> make-fresh-user-module is not documented.  It might be worth adding it
> to the documentation.

it definitely might ;)



  reply	other threads:[~2014-01-04 22:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-03 23:34 libguile thread safety Chris Vine
2014-01-04  0:00 ` Ludovic Courtès
2014-01-04 17:19   ` Chris Vine
2014-01-04  0:08 ` Panicz Maciej Godek
2014-01-04  0:22   ` Chris Vine
2014-01-04  0:56     ` Panicz Maciej Godek
2014-01-04  1:22       ` Panicz Maciej Godek
2014-01-04  9:39         ` Chris Vine
2014-01-04 21:28           ` Mark H Weaver
2014-01-04  1:59 ` Mark H Weaver
2014-01-04  9:50   ` Chris Vine
2014-01-04 12:44   ` Chris Vine
2014-01-04 15:01     ` Panicz Maciej Godek
2014-01-04 17:16       ` Chris Vine
2014-01-04 19:37       ` Mark H Weaver
2014-01-04 21:01         ` Chris Vine
2014-01-04 22:43           ` Panicz Maciej Godek [this message]
2014-01-04 23:31             ` Chris Vine
2014-01-05 13:15               ` Panicz Maciej Godek
2014-01-05 17:37                 ` Mark H Weaver
2014-03-18 10:49                   ` Chris Vine
2014-03-18 15:22                     ` Mark H Weaver
2014-03-18 19:32                       ` Chris Vine

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='CAMFYt2ZrabqvoLeSD8kaZBQu9Ne1XFcFf3e-gSBq=yrP+Eauvg@mail.gmail.com' \
    --to=godek.maciek@gmail.com \
    --cc=chris@cvine.freeserve.co.uk \
    --cc=guile-user@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).