This code hang up Linux VM..probably it is my fault...:((

Lex Spoon lex at cc.gatech.edu
Wed Feb 16 23:36:31 UTC 2000


Interesting bug.  I think the problem is that priorities should not go
below 1.  I don't want to try it myself, though, just right now, if it's
going to crash my image :)

Usually people choose a priority using the named priorities in Process. 
For instance, you can do:

	process priority: Processor userBackgroundPriority

By the way, you might want to put a "Processor active yield" inside your
busy loop.  Squeak processes are only interrupted if:

	1. They suspend or yield
	2. A higher-priority process becomes runnable

Thus if you busy-loop without a yield, you can lock your system up....

Lex




Piero Campanelli <campanelli at skylink.it> wrote:
> 
> Here it is the code:
> 
> EchoServer>>initialize
> 
> queue :=ConnectionQueue portNumber: 5000 queueLength: 1.
> process :=[ x :=queue getConnectionOrNil.
> 	  [ x isNil ] whileTrue: 
> 			[ x :=queuegetConnectionOrNil. ].
> 			self acceptConnection: x] newProcess.
> process priority: 0.
> 	
> -----
> 
> that i do a process start and under Linux i receive:
> 
> campanelli at linux squeak]$ vm/squeak images/Squeak2.8aConn1.image 
> 
> Segmentation fault
> 
> 1086586188 EchoServer>start
> 1086585784 UndefinedObject>DoIt
> 1086569272 Compiler>evaluate:in:to:notifying:ifFail:
> 1086563920 ParagraphEditor>evaluateSelection
> 1086563828 ParagraphEditor>doIt
> 1086564104 [] in ParagraphEditor>doIt:
> 1086563644 Controller>terminateAndInitializeAround:
> 1086563552 ParagraphEditor>doIt:
> 
> ------------------
> 
> probably there is a problem with my configuration or perhaps i make
> mistakes creating a server socket.
> 
> How do you create a Server Socket ?
> 
> S1) Create a ConnectionQueue
> S2) Create a low priority process that polls the queue
> S3) get the socket from the queue
> 
> Is there a better way ???
> 
> Tnx





More information about the Squeak-dev mailing list