8 core Mac Pro: Squeak and Croquet

John M McIntosh johnmci at smalltalkconsulting.com
Fri Apr 27 20:09:34 UTC 2007


On Apr 27, 2007, at 12:25 PM, J J wrote:

> I'm a little confused here.  Are you running Squeak or Croquet with  
> native threads somehow?
>
> Thanks,
> Jason

Well on OS-X the mac carbon VM runs with at least  5 threads.  One  
thread is the UI and the squeak VM interpreter loop
The other 4 threads handle file I/O, sound I/O, socket I/O, desktop  
services, display I/O.

Thus when you send data to socket, write to a file, play sound, draw  
to the screen, and after the squeak VM thread has talked to the
host operating system api and the api is  happy with the data , the  
request is spun off to another native thread for processing.

Of course in this case in Croquet since it's doing Open/GL stuff the  
graphics work is done on other threads once
the open/GL completes whatever processing is required on the Squeak  
thread.   This allows of course on a mulitple processor
machine the ability for you to overlap drawing and I/O without  any  
involvement of the Squeak VM programmer.

So yes Squeak is running one thread for the Squeak VM, but many  
threads processing host operating system calls.

I'll note it was discussed on the VisualWorks mailing list that there  
is a large performance hit if you allow a process to switch from
one CPU core to another, which Daniel notes below. Windows provides  
an API call that allows you to mark an application to be dedicated
to a CPU core, but that led to more discussion about how this was not  
a good solution either. Really the Operating System Vendors need to
be a bit better in their process switching algorithms and ensure a  
restarted thread should restart on the same CPU core to  take  
advantage of
any existing cached bits.  This issue should not rely on special need  
cases hacked by any old programmer.

>
>> From: Daniel Lanovaz <daniel at precedia.com>
>> Reply-To: The general-purpose Squeak developers list<squeak- 
>> dev at lists.squeakfoundation.org>
>> To: squeak-dev at lists.squeakfoundation.org
>> Subject: 8 core Mac Pro: Squeak and Croquet
>> Date: Sat, 21 Apr 2007 11:06:14 -0700
>>
>> The following are some screenshots of the CPU monitor
>> (one bar per core) running Squeak and Croquet on the
>> latest 8 core Mac Pro.
>>
>> It appears true that Tiger does elicit "core swapping"
>> behavior, the movement of threads between cores as they
>> execute. The performance monitor showed Squeak having two
>> threads, with activity on all 8 cores during normal operation
>> (except during one of the infinite loop tests), where the
>> core activity includes, of course, OS threads for window
>> management, etc.
>>
>> This test was certainly not scientific.
>>
>> With Squeak/Croquet riding atop 24 GHz of
>> 64-bit compute power, plus the muscle of an ATI X1900
>> GPU, the text editing appears to go smoothly. ;-)
>>
>> The core swapping issue may supposedly be altered in Leopard.
>> There is probably little performance degradation if the
>> thread stays on one quad-core chip with the shared L2 cache,
>> but if the thread moves to another quad-core chip, the
>> (instruction/data) cache contents need to be reloaded on the
>> second chip. The second Squeak infinite loop test appears
>> to show the main Squeak thread moving between two
>> quad-core chips.
>>
>> I purchased this machine for 3D animation rendering. My
>> render software wonderfully takes advantage of all 8
>> cores, with some impressive performance gains.
>>
>> Cheers,
>> Daniel
>>
>> CPU core usage
>> ==============
>>
>> Squeak GUI activity:
>> 	http://idisk.mac.com/iphone2007-Public/Squeak/squeak-8-core-01.jpg
>>
>> 	NOTE: Lots of dragging in a text view.
>>
>> Squeak in an infinite loop:
>> 	http://idisk.mac.com/iphone2007-Public/Squeak/squeak-8-core-  
>> infinite-02.jpg
>>
>> 	NOTE: Squeak is remaining on 1 core as nothing
>> 	else happens on the system.
>>
>> Squeak in an infinite loop (switching applications):
>> 	http://idisk.mac.com/iphone2007-Public/Squeak/squeak-8-core-  
>> infinite-03.jpg
>>
>> 	NOTE: Squeak's infinite loop is moving between cores
>> 	as I switch between applications.
>>
>> Croquet GUI activity:
>> 	http://idisk.mac.com/iphone2007-Public/Squeak/croquet.1.0.18-8- 
>> core.jpg
>>
>> 	NOTE: I was just walking around inside a space.
>>
>
> _________________________________________________________________
> Mortgage rates near historic lows. Refinance $200,000 loan for as  
> low as $771/month* https://www2.nextag.com/goto.jsp? 
> product=100000035&url=% 
> 2fst.jsp&tm=y&search=mortgage_text_links_88_h27f8&disc=y&vers=689&s=40 
> 56&p=5117
>
>

--
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===





More information about the Squeak-dev mailing list