On Mon, Jul 17, 2006 at 10:40:12PM +0100, Marco Monteiro wrote: > Matthew Astley wrote:
> > Here's a spec idea: could one declare a thread to be an outcast, > > banned from touching any specials or shared lexicals that don't > > meet some standard locking mechanism? What I was after was some way to avoid accidentally getting hold of things that are dangerous. On access to variables, it seems Perl takes the opposite approach in its current formulation of threading. From the threads::shared manpage for 5.8.7, By default, variables are private to each thread, and each newly created thread gets a private copy of each existing variable. This module allows you to share variables across different threads [...] I haven't investigated what happens when references to thingies (a technical term) are passed between threads. However, this does seem to be a flat place to start building "no access to dangerous things". There might be some ideas there... [...] > I don't think so. This would be too intrusive. Something could be built to make CL more like the Perl style. The language defines a set of globals and gives access to enumerate others that have been added. With exceptions for strange things like symbol-macros, it would be possible to automatically rebind _all_ those variables during spawn-thread. Perhaps when requested by one of those &allow-other-keys The thread can still use CL functions, but can't (for example) interfere with *read-base* or *print-escape* in another thread. It's possible. Is it useful? Matthew #8-) _______________________________________________ Gardeners mailing list [email protected] http://www.lispniks.com/mailman/listinfo/gardeners
