[squeak-dev] what was the index of TheInputSemaphore in older VMs?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] what was the index of TheInputSemaphore in older VMs?

Eliot Miranda-2
Hi All,

    just noptied that in our current VM there's an undefined constant TheInputSemaphore.  This is (or rather isn't) used in Interpreter>>primitiveInputSemaphore.  I can find no clue in my current images as to what its correct old value.  Anyone have the old value (in the Interpreter and/or in Smalltalk>>specialObjectsArray)?  TIA

Eliot


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] what was the index of TheInputSemaphore in older VMs?

johnmci
That was the original Squeak code to deal with the interrupt key.

I you pressed the interrupt key, then the VM would see that and set  
the interruptPending flag which later in checkForInterrrupts would  
grab the TheInterruptSemaphore
which was a semaphore that the Smalltalk interrupt  handler was  
waiting on to let the image know the interrupt key was pressed

Obviously there was a problem in determining what an interrupt key was  
across all platforms, and what if you wanted to changed it?
That led to the code being moved out of the VM into  
EventSensor>>processEvent:   -> "Check if the event is a user interrupt"
were we look for the magic keystrokes versus doing that in the VM.

However the TheInterruptSemaphore logic in the VM still exists to  
handle images from before the EventSensor work,  and is set via  
InputSensor>>installInterruptWatcher
EventSensor>>primInterruptSemaphore: records the semaphore so it can  
use it directly.


In *theory* *cough* you should be able to take a current mac vm and  
open a squeak image from 1995, if any one cares to try, please let me  
know if it works.


On 28-Jan-09, at 1:22 PM, Eliot Miranda wrote:

> Hi All,
>
>     just noptied that in our current VM there's an undefined  
> constant TheInputSemaphore.  This is (or rather isn't) used in  
> Interpreter>>primitiveInputSemaphore.  I can find no clue in my  
> current images as to what its correct old value.  Anyone have the  
> old value (in the Interpreter and/or in  
> Smalltalk>>specialObjectsArray)?  TIA
>
> Eliot
>

--
=
=
=
========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
=
=
=
========================================================================




Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] what was the index of TheInputSemaphore in older VMs?

Eliot Miranda-2


On Wed, Jan 28, 2009 at 2:03 PM, John M McIntosh <[hidden email]> wrote:
That was the original Squeak code to deal with the interrupt key.

I you pressed the interrupt key, then the VM would see that and set the interruptPending flag which later in checkForInterrrupts would grab the TheInterruptSemaphore
which was a semaphore that the Smalltalk interrupt  handler was waiting on to let the image know the interrupt key was pressed

Obviously there was a problem in determining what an interrupt key was across all platforms, and what if you wanted to changed it?
That led to the code being moved out of the VM into EventSensor>>processEvent:   -> "Check if the event is a user interrupt"
were we look for the magic keystrokes versus doing that in the VM.

However the TheInterruptSemaphore logic in the VM still exists to  handle images from before the EventSensor work,  and is set via InputSensor>>installInterruptWatcher
EventSensor>>primInterruptSemaphore: records the semaphore so it can use it directly.


In *theory* *cough* you should be able to take a current mac vm and open a squeak image from 1995, if any one cares to try, please let me know if it works.

It certainly _won't_ work unless  TheInterruptSemaphore is defined as the correct index in the specialObjectsArray, which is what I'm asking for.  Right now TheInterruptSemaphore is defined as null:

#define TheInterruptSemaphore null

so if one opens up the 1995 image and it tries to set the input semaphore it'll simply overwrite nil, which won't make the system very happy.  So once again,

anyone know what the correct value for TheInputSemaphore should be in a circa 1995 VM/image?

TIA




On 28-Jan-09, at 1:22 PM, Eliot Miranda wrote:

Hi All,

   just noptied that in our current VM there's an undefined constant TheInputSemaphore.  This is (or rather isn't) used in Interpreter>>primitiveInputSemaphore.  I can find no clue in my current images as to what its correct old value.  Anyone have the old value (in the Interpreter and/or in Smalltalk>>specialObjectsArray)?  TIA

Eliot


--
===========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================







Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: what was the index of TheInputSemaphore in older VMs?

Andreas.Raab
Eliot Miranda wrote:
> #define TheInterruptSemaphore null
>
> so if one opens up the 1995 image and it tries to set the input
> semaphore it'll simply overwrite nil, which won't make the system very
> happy.  So once again,
>
> anyone know what the correct value for TheInputSemaphore should be in a
> circa 1995 VM/image?

ObjectMemory>>initializeSpecialObjectIndices
        ProcessSignalingLowSpace := 22. "was TheInputSemaphore"

I think "reusing" this index is wrong and should be considered broken
(though it certainly doesn't matter for the Cog VM).

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: what was the index of TheInputSemaphore in older VMs?

Eliot Miranda-2


On Wed, Jan 28, 2009 at 2:59 PM, Andreas Raab <[hidden email]> wrote:
Eliot Miranda wrote:
#define TheInterruptSemaphore null

so if one opens up the 1995 image and it tries to set the input semaphore it'll simply overwrite nil, which won't make the system very happy.  So once again,

anyone know what the correct value for TheInputSemaphore should be in a circa 1995 VM/image?

ObjectMemory>>initializeSpecialObjectIndices
       ProcessSignalingLowSpace := 22. "was TheInputSemaphore"

I think "reusing" this index is wrong and should be considered broken (though it certainly doesn't matter for the Cog VM).

I agree.  The right thing to do then is to rip out TheInputSemaphore and make primInputSemaphore: fail for older usage.
  


Cheers,
 - Andreas




Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] what was the index of TheInputSemaphore in older VMs?

David T. Lewis
In reply to this post by johnmci
On Wed, Jan 28, 2009 at 02:03:55PM -0800, John M McIntosh wrote:
>
> In *theory* *cough* you should be able to take a current mac vm and  
> open a squeak image from 1995, if any one cares to try, please let me  
> know if it works.

A Squeak 2.8 image, circa about 2000, is still usable, but Squeak 1.1
from 1997 is not.

Older images have all of what is now called "VMMaker" in the base
image, so it's a good idea to keep a couple of these older images
at hand (ftp.squeak.org). Going back to Squeak 3.4 (a good solid
version) is usually far enough back to answer questions like this.

Dave