Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31131

Re: __builtins__ thread-safe / __builtins__ as function?

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <d@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.028
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'encouraging': 0.07; 'python': 0.09; 'globals': 0.09; 'cc:addr:python-list': 0.10; 'read.': 0.13; 'library': 0.15; 'dictionary,': 0.16; 'threads': 0.16; 'wrote:': 0.17; 'variables': 0.17; 'module': 0.19; 'earlier': 0.21; 'meant': 0.21; 'features,': 0.22; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'specifically': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; '(which': 0.26; 'am,': 0.27; 'updating': 0.27; 'run': 0.28; "they'll": 0.29; 'skip:_ 10': 0.29; 'maybe': 0.29; 'code': 0.31; 'problem.': 0.32; 'system,': 0.32; 'cases,': 0.33; 'that,': 0.34; 'changed': 0.34; 'subject:?': 0.35; 'continue': 0.35; 'there': 0.35; 'but': 0.36; 'modules': 0.36; 'quite': 0.37; 'subject:: ': 0.38; 'nothing': 0.38; 'several': 0.39; 'release': 0.39; 'received:192': 0.39; 'little': 0.39; 'where': 0.40; 'received:192.168': 0.40; 'subject:-': 0.40; 'your': 0.60; 'skip:u 10': 0.60; 'share': 0.61; 'first': 0.61; 'kind': 0.61; 'time,': 0.62; 'our': 0.65; 'header:Reply-To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72
Date Thu, 11 Oct 2012 16:28:26 -0400
From Dave Angel <d@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0
MIME-Version 1.0
To Juergen Bartholomae <bartholomae.juergen@googlemail.com>
Subject Re: __builtins__ thread-safe / __builtins__ as function?
References <CAAj3U_Ce+F6u+mhUy+_3uNXp4ck2QXtUw+7VG4wo9H88hJs0pQ@mail.gmail.com>
In-Reply-To <CAAj3U_Ce+F6u+mhUy+_3uNXp4ck2QXtUw+7VG4wo9H88hJs0pQ@mail.gmail.com>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:6h8PSr/DwZHTZjpM39oLHjJPdfsuQyq+1/nfdw7/RfN lI8ErpRLyZiyVSW9+uKHxHhIX7SwTwoQkkipQ+i50oesCxf+cQ bjR25z07HE1lGeDFEeLGfiXP1sRhnEdjDTKlYdGbVmedD59EzF yxqpZ8kAdAt0+jmpwNWlUuYGklOqV26bYpB+wgRXAwlgovi8rw 8/0hb7Fv/zv425wVONfz3LQPyycF3yS49NgnXG0UA3xkSRU9+Z aKbJgilRi7IP81jLg5f8b5xNiPM7DNGuaWGnkBx8YYaZYO44OG nEpeja09/Pq6Ir+mDU+SaE8si9XP4GqJVRapHeNcD/yUkKz/g= =
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To d@davea.name
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2064.1349987335.27098.python-list@python.org> (permalink)
Lines 32
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1349987335 news.xs4all.nl 6846 [2001:888:2000:d::a6]:49121
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:31131

Show key headers only | View raw


On 10/11/2012 10:16 AM, Juergen Bartholomae wrote:
> Hello.
> I have quite a peculiar problem.
>
> A little overview of our situation:
> Our program enables our users to write their own python code (which they
> use extensively).
> Unfortunately, (due to us actually encouraging this in an earlier release
> (!stupid!)) this meant that, in several cases, there are modules which use
> __builtins__ as a kind of global dictionary, where various variables are
> inserted, changed and read.
>
> Now, currently we are updating our program from a single-threaded to a
> multithreaded architecture.
> -> Of course, this means that the same module can now run in several
> threads at the same time, and, since __builtins__ is pretty much global in
> the system, they all share the same __builtins__.

And that's just the first problem.  Maybe you can just let your new
library revert to the old one unless the calling module specifically
activates the new features.

That way existing modules will continue to work the old way, and if they
want new features, they'll need to follow new constraints.  One of these
is no globals, including nothing added to __builtins__   But remember
that their own globals are just as problematic.


-- 

DaveA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: __builtins__ thread-safe / __builtins__ as function? Dave Angel <d@davea.name> - 2012-10-11 16:28 -0400

csiph-web