Mac VM 3.5.0b4 lurks

John M McIntosh johnmci at
Wed Apr 9 17:25:27 UTC 2003

I should point out that a mac vm 3.5.0b4 lurks in

This VM has has the following changes, beyond all the work to change  
how the plugin logic works, the most significant performance change is  
point (b) in the 3.5.0b3 work, so it's really really worth downloading  
and trying.

a) os-x exposed an issue with EToyPeerToPeer support. It seems under  
os-x we get the connect, data, close so fast on lans that by the time  
we get around to asking for the remote IP address the connection is  
closed, and our open transport call fails. We change SqMacNetwork.c to  
return the IP address discovered at connect time in this case. Under  
os-9 we never saw this behavior because we suspect the network activity  
was slower and more serialized.

3.5.0b3 (Safari support)

a) The plugin logic was changed to support Safari and better support  
os-x. This required building a CFM stub to load the mach-o compiled  
NSPLugin. The mach-o plugin now uses a pthread for the interp.c loop.  
This gives much better performance and user UI feedback.
b) The GC logic was carefully reworked to optimize the assembler on the  
ppc. This gave us upwards of a 30-50% improvement, since incremental GC  
is going on all the time, this change actually has a effect you can see  
say in the solitaire example where we save 10%.
c) sqMacNetwork.c was modified, first change in many years. The remote  
address and port number are requested as an async operation. The  
operation times out after a few milliseconds. This was never a problem  
in os-9. Now it seems there is an issue sometimes for DHCP clients on  
os-x. There the operation can timeout and return 0 as the address or  
port. We changed the call to do a sync operation to avoid a timeout.
d) sqMacMain.c was modified to allow for pthreads for mach-o netscape  
based squeakland plugin support
e) sqMacMemory.c changes for mach-o plugin support
f) sqMacTime.c changes for  mach-o plugin support
g) sqMacUIEvents.c changes for mach-o plugin support
h) sqMacWindow.c changes for mach-o plugin support
i) npmac.cpp now this is a netscape glue routine, I changed it to  
ensure we can see the entry points, originally they are C++, but need  
to be "C" so the loader can find the names the CFM glue routine is  
looking for. Also we add the logic TV2FP to setup the mach-0 to CFM  
code stubs to allow the mach-o plugin to callback to the CFM stubs in  
j) sqMacNSPlugin.c
	1) Rearrange when the interpret() thread is started to ensure a race  
condition doesn't happen.
	2) use Pthreads for the mach-o osx version.
	3) rework NPP_SetWindow to start interpret() when needed.
	4) Alter StartDraw, EndDraw to use a mutex lock and handle os-x port  
locking to prevent races between pthreads.
	5) Alter ioShowDisplay, optimization and handle os-x
	6) fix ioSetFullScreen to make it work on Safari
	7) fix OpenFileReadOnly to make it work on os-x, needed  
sqFileNameFromStringOpen macro call
	8) Alter ExitCleanup to mutex lock to prevent race ending issues, and  
add a bit more cleanup

John M. McIntosh <johnmci at> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.

More information about the Squeak-dev mailing list