A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-ct.1368.mcz ==================== Summary ==================== Name: Kernel-ct.1368 Author: ct Time: 24 January 2021, 3:19:48.003384 pm UUID: c62a6062-b240-9149-a2ed-78fdc1079dfd Ancestors: Kernel-mt.1364 Proposal: Always include process name into its print string. This facilitates debugging/inspecting of multiprocess scenarios. =============== Diff against Kernel-mt.1364 =============== Item was changed: ----- Method: Process>>longPrintOn: (in category 'printing') ----- longPrintOn: stream | ctxt | super printOn: stream. + stream + nextPut: $(; + nextPutAll: self name; + nextPut: $). stream cr. ctxt := self suspendedContext. [ctxt == nil] whileFalse: [ stream space. ctxt printOn: stream. stream cr. ctxt := ctxt sender. ]. ! Item was changed: ----- Method: Process>>printOn: (in category 'printing') ----- printOn: aStream super printOn: aStream. + aStream + nextPut: $(; + nextPutAll: self name; + nextPut: $). aStream nextPutAll: ' in '. suspendedContext printOn: aStream! |
Hi Christoph,
only a few processes have a name. Surely this should test from there being a name and not print some noise if it doesn’t have a name. _,,,^..^,,,_ (phone) > On Jan 24, 2021, at 6:19 AM, [hidden email] wrote: > > A new version of Kernel was added to project The Inbox: > http://source.squeak.org/inbox/Kernel-ct.1368.mcz > > ==================== Summary ==================== > > Name: Kernel-ct.1368 > Author: ct > Time: 24 January 2021, 3:19:48.003384 pm > UUID: c62a6062-b240-9149-a2ed-78fdc1079dfd > Ancestors: Kernel-mt.1364 > > Proposal: Always include process name into its print string. This facilitates debugging/inspecting of multiprocess scenarios. > > =============== Diff against Kernel-mt.1364 =============== > > Item was changed: > ----- Method: Process>>longPrintOn: (in category 'printing') ----- > longPrintOn: stream > > | ctxt | > super printOn: stream. > + stream > + nextPut: $(; > + nextPutAll: self name; > + nextPut: $). > stream cr. > ctxt := self suspendedContext. > [ctxt == nil] whileFalse: [ > stream space. > ctxt printOn: stream. > stream cr. > ctxt := ctxt sender. > ]. > ! > > Item was changed: > ----- Method: Process>>printOn: (in category 'printing') ----- > printOn: aStream > > super printOn: aStream. > + aStream > + nextPut: $(; > + nextPutAll: self name; > + nextPut: $). > aStream nextPutAll: ' in '. > suspendedContext printOn: aStream! > > |
Hi Eliot,
thanks for the feedback! I actually intended to print their short hash if they don't have a real name because this can still be very helpful in order to differentiate between multiple processes each suspended in the same method. It would also help me to identify a process from the process browser somewhere else. Do you get my point? :-)
Best, Christoph Von: Squeak-dev <[hidden email]> im Auftrag von Eliot Miranda <[hidden email]>
Gesendet: Sonntag, 24. Januar 2021 15:55:42 An: [hidden email] Betreff: Re: [squeak-dev] The Inbox: Kernel-ct.1368.mcz Hi Christoph,
only a few processes have a name. Surely this should test from there being a name and not print some noise if it doesn’t have a name. _,,,^..^,,,_ (phone) > On Jan 24, 2021, at 6:19 AM, [hidden email] wrote: > > A new version of Kernel was added to project The Inbox: > http://source.squeak.org/inbox/Kernel-ct.1368.mcz > > ==================== Summary ==================== > > Name: Kernel-ct.1368 > Author: ct > Time: 24 January 2021, 3:19:48.003384 pm > UUID: c62a6062-b240-9149-a2ed-78fdc1079dfd > Ancestors: Kernel-mt.1364 > > Proposal: Always include process name into its print string. This facilitates debugging/inspecting of multiprocess scenarios. > > =============== Diff against Kernel-mt.1364 =============== > > Item was changed: > ----- Method: Process>>longPrintOn: (in category 'printing') ----- > longPrintOn: stream > > | ctxt | > super printOn: stream. > + stream > + nextPut: $(; > + nextPutAll: self name; > + nextPut: $). > stream cr. > ctxt := self suspendedContext. > [ctxt == nil] whileFalse: [ > stream space. > ctxt printOn: stream. > stream cr. > ctxt := ctxt sender. > ]. > ! > > Item was changed: > ----- Method: Process>>printOn: (in category 'printing') ----- > printOn: aStream > > super printOn: aStream. > + aStream > + nextPut: $(; > + nextPutAll: self name; > + nextPut: $). > aStream nextPutAll: ' in '. > suspendedContext printOn: aStream! > >
Carpe Squeak!
|
I like this proposal. It has no effect on the ProcessBrowser, and is
helpful when looking at processes elsewhere. Most processes do not have a name, but all processes respond in a concise and useful way to #name. Process>>name ^name ifNil: [ self hash asString forceTo: 5 paddingStartWith: $ ] So +1 from me Dave On Sun, Jan 24, 2021 at 03:28:20PM +0000, Thiede, Christoph wrote: > Hi Eliot, > > > thanks for the feedback! I actually intended to print their short hash if they don't have a real name because this can still be very helpful in order to differentiate between multiple processes each suspended in the same method. It would also help me to identify a process from the process browser somewhere else. Do you get my point? :-) > > > Best, > > Christoph > > <http://www.hpi.de/> > ________________________________ > Von: Squeak-dev <[hidden email]> im Auftrag von Eliot Miranda <[hidden email]> > Gesendet: Sonntag, 24. Januar 2021 15:55:42 > An: [hidden email] > Betreff: Re: [squeak-dev] The Inbox: Kernel-ct.1368.mcz > > Hi Christoph, > > only a few processes have a name. Surely this should test from there being a name and not print some noise if it doesn???t have a name. > > _,,,^..^,,,_ (phone) > > > On Jan 24, 2021, at 6:19 AM, [hidden email] wrote: > > > > ???A new version of Kernel was added to project The Inbox: > > http://source.squeak.org/inbox/Kernel-ct.1368.mcz > > > > ==================== Summary ==================== > > > > Name: Kernel-ct.1368 > > Author: ct > > Time: 24 January 2021, 3:19:48.003384 pm > > UUID: c62a6062-b240-9149-a2ed-78fdc1079dfd > > Ancestors: Kernel-mt.1364 > > > > Proposal: Always include process name into its print string. This facilitates debugging/inspecting of multiprocess scenarios. > > > > =============== Diff against Kernel-mt.1364 =============== > > > > Item was changed: > > ----- Method: Process>>longPrintOn: (in category 'printing') ----- > > longPrintOn: stream > > > > | ctxt | > > super printOn: stream. > > + stream > > + nextPut: $(; > > + nextPutAll: self name; > > + nextPut: $). > > stream cr. > > ctxt := self suspendedContext. > > [ctxt == nil] whileFalse: [ > > stream space. > > ctxt printOn: stream. > > stream cr. > > ctxt := ctxt sender. > > ]. > > ! > > > > Item was changed: > > ----- Method: Process>>printOn: (in category 'printing') ----- > > printOn: aStream > > > > super printOn: aStream. > > + aStream > > + nextPut: $(; > > + nextPutAll: self name; > > + nextPut: $). > > aStream nextPutAll: ' in '. > > suspendedContext printOn: aStream! > > > > > > |
Hi David, On Sun, Jan 24, 2021 at 8:10 AM David T. Lewis <[hidden email]> wrote: I like this proposal. It has no effect on the ProcessBrowser, and is 5 is too short. The identityHash in Spur has 7 digits of significance and hash => scaledIdentityHash => identityHash * 256. Also asString is lazy; it just calls printString. I wouldn't contract at all: Process>>name ^name ifNil: [self hash printString]
_,,,^..^,,,_ best, Eliot |
On Mon, Jan 25, 2021 at 05:05:05PM -0800, Eliot Miranda wrote:
> Hi David, > > On Sun, Jan 24, 2021 at 8:10 AM David T. Lewis <[hidden email]> wrote: > > > I like this proposal. It has no effect on the ProcessBrowser, and is > > helpful when looking at processes elsewhere. > > > > Most processes do not have a name, but all processes respond in a concise > > and useful way to #name. > > > > Process>>name > > ^name ifNil: [ self hash asString forceTo: 5 paddingStartWith: $ ] > > > > 5 is too short. The identityHash in Spur has 7 digits of significance and > hash => scaledIdentityHash => identityHash * 256. Also asString is lazy; > it just calls printString. I wouldn't contract at all: > > Process>>name > ^name ifNil: [self hash printString] > > > > So +1 from me > > What I said is that I like Christoph's proposal, that's all. If we think that we should change the implementation of Process>>name that's fine too, but let's not it get in the way of merging Christoph's suggestion into trunk. OK? Dave |
Free forum by Nabble | Edit this page |