Browse Prior Art Database

Process Based Namespacing in Smalltalk

IP.com Disclosure Number: IPCOM000115866D
Original Publication Date: 1995-Jul-01
Included in the Prior Art Database: 2005-Mar-30
Document File: 2 page(s) / 65K

Publishing Venue

IBM

Related People

Wilson, T: AUTHOR

Abstract

Disclosed is a method by which the Smalltalk process model can be extended to include a notion of context of execution.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Process Based Namespacing in Smalltalk

      Disclosed is a method by which the Smalltalk process model can
be extended to include a notion of context of execution.

Suppose the following is defined:
  Object subclass: #ProcessContext
  instanceVariableNames: 'contextDictionary '
  classVariableNames: ''
  poolDictionaries: ''

      Each Smalltalk process would have an instance variable that
would hold an instance of the above class.  The purpose of the
contextDictionary is to hold associations keyed by the same symbols
that exist in the Smalltalk dictionary that reference objects that
one wants specifically for this process' thread of execution.  Thus,
in the case of the 4GL interpretive engines running in 2 separate
processes P1 and P2, P1 would contain a ProcessContext with a
dictionary containing the association:
  #CurrentRunUnit ==> A1
  whereas P2 would contain aProcessContext with a dictionary
containing
  #CurrentRunUnit ==> A2

When the Processor switch processes, the following occurs:
  o  The process being switched out sets values from Smalltalk
      dictionary into its process context; the process saves its
      context.
  o  The process being scheduled to run sets the values in its
context
      into the Smalltalk dictionary.
  o  The actual switch occurs and the new process starts executing.

      In this way, each time a given process is scheduled to run it
sets back into the Smalltalk dictionary the state of the global
variables that were there from the last time that it run.  Thus, each
process can have its own values for a given set of globals; processes
P1 and P2 can run concurrently and the code that references
#CurrentRunUnit will be referencing the right object in each case.

      The key here is that...