Is Wrapping Safe? [Re: Is Set growth thread-safe?]

jwalsh at bigpond.net.au jwalsh at bigpond.net.au
Thu Sep 22 21:32:50 UTC 2005



Thanks Ross, you have given me the partial answer to a problematic which has bugged me for a while:
It started off as "Is Smalltalk safe from Windows?",
Then progressed to "Is Smalltalk safe from 'C' ?",
Now its "Is Smalltalk Safe from Smalltalk".
This was originally a problem which could not ever happen to Smalltalk.
Encapsulation and Message passing meant the Method was safe, from intrudere.
Can someone please convince me that Smalltalk is safe from 'C' hackers.
JW

---- Ross Boylan <RossBoylan at stanfordalumni.org> wrote: 
> Thanks everyone for setting me straight.  It seems reasonable that
> classes are not generally thread-safe, but in the original issue that
> got me into this, WeakIdentityKeyDictionary, it seems problematic.
> 

Research:

http://minnow.cc.gatech.edu/squeak/1891 >   http://www.laputan.org/brant/brant.html  :-

MethodWrappers for Squeak
Robert Hirschfeld (hirschfeld at acm.org) wrote

 WARNING! Incorrectly using the MethodWrappers port may result in
 an inconsistent image that can't be trusted anymore. Therefore,
 before experimenting with the MethodWrappers port, please save
 and backup your image.


SNIP
Wrappers to the Rescue

John Brant, Brian Foote, Ralph E. Johnson, and Donald Roberts
Department of Computer Science
 University of Illinois at Urbana-Champaign
 Urbana, IL 61801
{brant, foote, johnson, droberts}@cs.uiuc.edu

Abstract. Wrappers are mechanisms for introducing new behavior that is executed before and/or after, and perhaps even in lieu of, an existing method. This paper examines several ways to implement wrappers in Smalltalk, and compares their performance. Smalltalk programmers often use Smalltalk’s lookup failure mechanism to customize method lookup. Our focus is different. Rather than changing the method lookup process, we modify the method objects that the lookup process returns. We call these objects method wrappers. We have used method wrappers to construct several program analysis tools: a coverage tool, a class collaboration tool, and an interaction diagramming tool. We also show how we used method wrappers to construct several extensions to Smalltalk: synchronized methods, assertions, and multimethods. Wrappers are relatively easy to build in Smalltalk because it was designed with reflective facilities that allow programmers to intervene in the lookup process. Other languages differ in the degree to which they can accommodate change. Our experience testifies to the value, power, and utility of openness.

ETC



More information about the Squeak-dev mailing list