The following code fragment is inside of a loop which is forked as a Process. It is part of a parallel simulation, in this case 2 images executing the models in the sim. When I execute the sim with this code in fails to #send:to: the #NULL Event.
lastNow = now ifFalse: [self cOut keysAndValuesDo: [:k :v | v ifFalse: [Daemon singleInstance send: (PackingData pack: (Event time: now + self lookAhead type: #NULL from: self mid to: k << 8 + 1)) to: k. self nullMsgSent: self nullMsgSent + 1]. lastNow _ now]].
If I change the above code to the following:
lastNow = now ifFalse: [self cOut keysAndValuesDo: [:k :v | v ifFalse: [self nullMsgSent: self nullMsgSent + 1. Daemon singleInstance send: (PackingData pack: (Event time: now + self lookAhead type: #NULL from: self mid to: k << 8 + 1)) to: k ]. lastNow _ now]].
the sim RUNS! ALL I've done is to move the single line:
self nullMsgSent: self nullMsgSent + 1.
from the beginning of the loop to the end of the loop. nullMsgSent is just an instance variable used as a counter and plays NO role in the logic of the code.
Any ideas why?
Could this be a problem in the code generation?
Could this be a problem with ProcessScheduler?
Elzbieta
On Fri, 2 Mar 2001, Elzbieta Chludzinska wrote:
The following code fragment is inside of a loop which is forked as a Process. It is part of a parallel simulation, in this case 2 images executing the models in the sim. When I execute the sim with this code in fails to #send:to: the #NULL Event.
lastNow = now ifFalse: [self cOut keysAndValuesDo: [:k :v | v ifFalse: [Daemon singleInstance send: (PackingData pack: (Event time: now + self lookAhead type: #NULL from: self mid to: k << 8 + 1)) to: k. self nullMsgSent: self nullMsgSent + 1]. lastNow _ now]].
If I change the above code to the following:
lastNow = now ifFalse: [self cOut keysAndValuesDo: [:k :v | v ifFalse: [self nullMsgSent: self nullMsgSent + 1. Daemon singleInstance send: (PackingData pack: (Event time: now + self lookAhead type: #NULL from: self mid to: k << 8 + 1)) to: k ]. lastNow _ now]].
the sim RUNS! ALL I've done is to move the single line:
self nullMsgSent: self nullMsgSent + 1.
from the beginning of the loop to the end of the loop. nullMsgSent is just an instance variable used as a counter and plays NO role in the logic of the code.
Any ideas why?
Could this be a problem in the code generation?
Seems unlikely to me.
Could this be a problem with ProcessScheduler?
What does send:to: do?
And what does it do when "it fails"? Is the send:to: called? You double-checked it's just the line you move around?
-- Bert
On Friday 02 March 2001 11:25, Elzbieta Chludzinska wrote:
When I execute the sim with this code in fails to #send:to: the #NULL Event.
What do you mean that it fails?
self nullMsgSent: self nullMsgSent + 1
What is the exact code for nullMsgSent: and nullMsgSent ? Do they do anything AT ALL beyond setting and getting an instance variable?
squeak-dev@lists.squeakfoundation.org