Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!gatech!dcatla!itwaf
From: itwaf@dcatla.UUCP (Bill Fulton [Sys Admin])
Newsgroups: comp.object
Subject: Re: Reentrant code
Message-ID: <24517@dcatla.UUCP>
Date: 3 Oct 89 20:40:09 GMT
References: <11242@eerie.acsu.Buffalo.EDU> <4513@internal.Apple.COM>
Reply-To: dcatla!itwaf@gatech.edu (Bill Fulton [Sys Admin])
Organization: DCA Inc., Alpharetta, GA
Lines: 49

In article <4513@internal.Apple.COM> Piersol@apple.com (Kurt Piersol) writes:
   [Responding to question about "object-oriented code" being re-entrant.]
>On the contrary, object-oriented code is in general highly reentrant. 
   [Followed by explaination which can be, I believe, paraphrased as:
    If there is a re-entrancy problem, it concerns the internal storage/passing
    of the instance data. His explaination specificly refers to message
    passing]

Don't be a prisoner of your paradigm! [(c) 1989 - Wm A Fulton]  :-)
(Messages are specific to certain implementations of OOPS)

Never the less, Kurt's point (if I understood it correctly), when generalized,
is relevant to all OOPS implementations, and is probably what prompted the
original question. Although most (probably all) OOPS implementations are as
stack oriented languages, information about a specific instance is not defined
to be passed on a stack and, thus, *the block of code* which operates on an
instance may not re-entrant.

I believe, however, that the original remark (questioning re-entrancy) was just
conjecture. For example, it's my understanding (although I'm quite a neophyte)
that, in C++, the instance info IS passed on the stack. Does anyone know if
there are OOPS languages which would be succeptable to the re-entrancy
problem? (e.g. in which instance info is passed in global storage) (This would
be a very important consideration when choosing a language!)

>Since the same code may be shared by many instances of an object class, 
>each with a different state, the code must be reentrant for the whole 
>scheme to work.

I don't agree with this remark; I think it's the definition of 're-entrant'
that's the problem. My understanding is that a block of re-entrant code must
support *concurrent* execution by different processes, not just sequential
execution by different callers in the same process. Thus, instance data must
be part of the "machine state" which is saved. (I may be off base here - it
appears that Kurt's point, above, refers to a specific language implementation).
Regardless, this point would be very relevant in these days of multi-processors
and light weight processes.

Well ... hope I haven't made too many basic conceptual errors here; I'm still
stuck in the "procedural paradigm".

>Kurt Piersol
>Senior Scientist

Bill Fulton
Junior G-Man
dcatla!itwaf@gatech.edu

[Come on Kurt - we're *Programmers* !]