Le 07/05/2015 18:43, Ben Coman a écrit :
On Thu, May 7, 2015 at 9:09 PM, Alain Rastoul <alf.mmm.cat@gmail.com> wrote:
Le 05/05/2015 14:35, Ben Coman a écrit :
Does the #printOn: really need a monitor? What is it protecting?
* not the stream, that is passed in as a parameter from a single thread
* not the class name, that is handled normally
* items size does "^ lastIndex - firstIndex + 1" in OrderedCollection, which presumably will be inlined and not interruptible, and even if it could be interrupted part way through the calculation to become inconsistent, the value is only printed, so do we really care?
Yes may be you are right, removing the critical: block is simpler and it is probably not very important here.
I am not clear on the semantics we want debugging ProcessLocalVariable, however if without forking I do...
variable := ProcessLocalVariable value: 'hello world'
then inspecting /variable/ shows me only...
self: a ProcessLocalVariable index: 6
And there is no change when forking...
process := [ variable := ProcessLocalVariable value: 'hello world'. variable inspect. ] fork.
Also, the following works as expected with respect to the /result/ variable.
| process variable result | process := [ variable := ProcessLocalVariable value: 'hello world'. self halt. result := variable value. ] fork.
So as ProcessLocalVariable is currently displayed in the debugger there seems no problem (?) for what the debugger displays.
cheers -ben
You will see a difference in inspecting without forking and with forking if you try to evaluate the variable value, not just open the inspector on it wihout forking => 'hello world' with forking => nil I thought of ProcessLocalVariable because I spent some time few month ago trying to debug a ZnServer and ZnCurrentServerSession is a local variable, it was my first experiment with the Process local variables. And I do not like ProcessLocalVariables too much, it was just a thought about effectiveProcess and the inspector with critical: blocks that could lead to hang the image. The debugger does its best to maintain effectiveProcess when running the process, not the inspector when evualuating. -- Regards, Alain