Threads or suggestion?

Stephen Pair spair at acm.org
Thu Aug 8 20:51:36 UTC 2002


What are these values?

startTime - when the process originally started, or when it was last
activated?
endTime - final termination? Or end of last activation?
accumulatedTime - total time? Or time since last activation?

I am interested in these things.  Also, I've been itching to make
Comanche do it's socket serving using processes that are pre-empted.
The only way I know that that can be achieved is to run a higher
priority process that loops around a timer event (like a Delay).  That
seems to me like it would probably be a good bit of overhead if you were
doing that say every 250 milliseconds.  It's not really a big deal for
comanche since its processes do tend to communicate with sockets a lot
(thus they frequently wait on semaphores)...but, if you go off and do
some big hunk of processing without talking to the socket, it can starve
the other processes.

Would it be possible to make the VM automatically switch contexts of any
process that exceeds some amount of time (and allow that setting to be
adjusted and enabled/disabled from Smalltalk)?  Would there be any
issues with doing something like that?

Also, since we're talking about adding instvars to Process...I'd like to
lobby for one to hold a name, and another to hold a runtime environment
(to store variables local to a process).

- Stephen

> -----Original Message-----
> From: squeak-dev-admin at lists.squeakfoundation.org 
> [mailto:squeak-dev-admin at lists.squeakfoundation.org] On 
> Behalf Of John M McIntosh
> Sent: Thursday, August 08, 2002 4:32 PM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: RE: Threads or suggestion?
> 
> 
> >You might also check out the Process and ProcessorScheduler 
> classes if 
> >you want more info on Squeak's processor scheduling 
> capabilities (both 
> >cooperative and preemptive scheduling is possible in Squeak).
> >
> >- Stephen
> 
> I should ask:
> 
> I've a VM change that captures the dispatch time for the currently 
> running process at the point of process context switch. Although some 
> of this logic is in smalltalk, the core dispatcher is in the interp.c 
> code. Thus you can't accurately track this value without a VM change.
> 
> This VM change adds three instances variables to a Process. 
> startTime endTime accumulatedTime
> 
> Right now people tend to use some type of watching process to account 
> for which process is mostly active or accumulating the most time. 
> This VM change ensures the information is recorded correctly.
> 
> If there is any interest I could drag this change out of my archives 
> and build a Mac VM?
> 
> -- 
> -- 
> ==============================================================
> =============
> John M. McIntosh <johnmci at smalltalkconsulting.com> 
> 1-800-477-2659 Corporate Smalltalk Consulting Ltd.  
> http://www.smalltalkconsulting.com
> 
> ==============================================================
> =============
> 
> 




More information about the Squeak-dev mailing list