Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.postscript > #1710 > unrolled thread
| Started by | luser- -droog <mijoryx@yahoo.com> |
|---|---|
| First post | 2013-10-05 20:34 -0700 |
| Last post | 2013-10-20 21:58 -0700 |
| Articles | 6 — 2 participants |
Back to article view | Back to comp.lang.postscript
How can systemdict contain userdict? luser- -droog <mijoryx@yahoo.com> - 2013-10-05 20:34 -0700
Re: How can systemdict contain userdict? luser- -droog <mijoryx@yahoo.com> - 2013-10-06 22:43 -0700
Re: How can systemdict contain userdict? luser- -droog <mijoryx@yahoo.com> - 2013-10-07 04:11 -0700
Re: How can systemdict contain userdict? ken <ken@spamcop.net> - 2013-10-07 17:22 +0100
Re: How can systemdict contain userdict? luser- -droog <mijoryx@yahoo.com> - 2013-10-08 17:35 -0700
Re: How can systemdict contain userdict? luser- -droog <mijoryx@yahoo.com> - 2013-10-20 21:58 -0700
| From | luser- -droog <mijoryx@yahoo.com> |
|---|---|
| Date | 2013-10-05 20:34 -0700 |
| Subject | How can systemdict contain userdict? |
| Message-ID | <88ad8558-3e12-41d4-85ce-7c77d470ae9d@googlegroups.com> |
How can systemdict contain userdict? Composite objects in global memory are not permitted to contain references to objects in local memory. How then is systemdict able to contain references to userdict, errordict and $error? The advantage of this restriction are clear when you consider that garbage collection can be performed separately for local and global VMs. A collection of local VM can be performed more cheaply since only local VM needs to be scanned. A collection of global VM, on the other hand, must scan both global and local VMs. userdict is probably fine, since the stacks are part of the root set. But how to keep $error from being garbage collected when it exists in local VM, but its reference is in global VM (in systemdict) and therefore not encountered during a scan of local VM roots?
[toc] | [next] | [standalone]
| From | luser- -droog <mijoryx@yahoo.com> |
|---|---|
| Date | 2013-10-06 22:43 -0700 |
| Message-ID | <2ad165cf-afb6-4dcf-b1ee-2322ff36feb3@googlegroups.com> |
| In reply to | #1710 |
On Saturday, October 5, 2013 10:34:46 PM UTC-5, luser- -droog wrote: > How can systemdict contain userdict? > > Composite objects in global memory are not permitted to contain references to objects in local memory. How then is systemdict able to contain references to userdict, errordict and $error? > > > > The advantage of this restriction are clear when you consider that garbage collection can be performed separately for local and global VMs. A collection of local VM can be performed more cheaply since only local VM needs to be scanned. A collection of global VM, on the other hand, must scan both global and local VMs. > > > > userdict is probably fine, since the stacks are part of the root set. But how to keep $error from being garbage collected when it exists in local VM, but its reference is in global VM (in systemdict) and therefore not encountered during a scan of local VM roots? The workaround I've found is to suppress the invalidaccess error while installing these local objects into systemdict, and keep dups in userdict for the collector to find.
[toc] | [prev] | [next] | [standalone]
| From | luser- -droog <mijoryx@yahoo.com> |
|---|---|
| Date | 2013-10-07 04:11 -0700 |
| Message-ID | <4e5f7637-9dc9-446d-96c6-f603b9c7aa75@googlegroups.com> |
| In reply to | #1711 |
On Monday, October 7, 2013 12:43:19 AM UTC-5, luser- -droog wrote: > On Saturday, October 5, 2013 10:34:46 PM UTC-5, luser- -droog wrote: > > > How can systemdict contain userdict? > > > > Composite objects in global memory are not permitted to contain references to objects in local memory. How then is systemdict able to contain references to userdict, errordict and $error? > > > > > > The advantage of this restriction are clear when you consider that garbage collection can be performed separately for local and global VMs. A collection of local VM can be performed more cheaply since only local VM needs to be scanned. A collection of global VM, on the other hand, must scan both global and local VMs. > > > > > > > > userdict is probably fine, since the stacks are part of the root set. But how to keep $error from being garbage collected when it exists in local VM, but its reference is in global VM (in systemdict) and therefore not encountered during a scan of local VM roots? > > > > The workaround I've found is to suppress the invalidaccess error while installing these local objects into systemdict, and keep dups in userdict for the collector to find. I suppose very few contributors here have had to worry about this (yet). Bugbear and Aandi, probably. Helmar, maybe. Ken, possibly, I don't know whether he works on the garbage collector. But I hope others get there! I want to start answering some questions about garbage collection, instead of endlessly asking them. :)
[toc] | [prev] | [next] | [standalone]
| From | ken <ken@spamcop.net> |
|---|---|
| Date | 2013-10-07 17:22 +0100 |
| Message-ID | <MPG.2cbcf014f4b685f69898af@usenet.plus.net> |
| In reply to | #1712 |
In article <4e5f7637-9dc9-446d-96c6-f603b9c7aa75@googlegroups.com>, mijoryx@yahoo.com says... > I suppose very few contributors here have had to worry about this (yet). Bugbear and Aandi, probably. Helmar, maybe. Ken, possibly, I don't know whether he works on > the garbage collector. I treat the Ghostscript garbage collector like a particularly nasty variety of plague, and Jaws doesn't do garbage collection, so that was never an issue.
[toc] | [prev] | [next] | [standalone]
| From | luser- -droog <mijoryx@yahoo.com> |
|---|---|
| Date | 2013-10-08 17:35 -0700 |
| Message-ID | <0b974865-9659-4f33-912c-ef8885356c4d@googlegroups.com> |
| In reply to | #1711 |
On Monday, October 7, 2013 12:43:19 AM UTC-5, luser- -droog wrote: > On Saturday, October 5, 2013 10:34:46 PM UTC-5, luser- -droog wrote: > > > How can systemdict contain userdict? > > > > > > Composite objects in global memory are not permitted to contain references to objects in local memory. How then is systemdict able to contain references to userdict, errordict and $error? > > > > > > > > > > > > The advantage of this restriction are clear when you consider that garbage collection can be performed separately for local and global VMs. A collection of local VM can be performed more cheaply since only local VM needs to be scanned. A collection of global VM, on the other hand, must scan both global and local VMs. > > > > > > > > > > > > userdict is probably fine, since the stacks are part of the root set. But how to keep $error from being garbage collected when it exists in local VM, but its reference is in global VM (in systemdict) and therefore not encountered during a scan of local VM roots? > > > > The workaround I've found is to suppress the invalidaccess error while installing these local objects into systemdict, and keep dups in userdict for the collector to find. Or, maybe this is the place to use name-chains! systemdict /userdict /localuserdict cvx put where localuserdict is the name in userdict for itself. And similarly with localerrordict and local$error. This should be user-transparent so long as access to userdict is always by autoloading rather than `load`ing. Symbolic links to span memory banks.
[toc] | [prev] | [next] | [standalone]
| From | luser- -droog <mijoryx@yahoo.com> |
|---|---|
| Date | 2013-10-20 21:58 -0700 |
| Message-ID | <69b77a89-eac5-4345-b3df-89091906bbb5@googlegroups.com> |
| In reply to | #1710 |
On Saturday, October 5, 2013 10:34:46 PM UTC-5, luser- -droog wrote: > How can systemdict contain userdict? > > Composite objects in global memory are not permitted to contain references to objects in local memory. How then is systemdict able to contain references to userdict, errordict and $error? > > > The advantage of this restriction are clear when you consider that garbage collection can be performed separately for local and global VMs. A collection of local VM can be performed more cheaply since only local VM needs to be scanned. A collection of global VM, on the other hand, must scan both global and local VMs. > > > userdict is probably fine, since the stacks are part of the root set. But how to keep $error from being garbage collected when it exists in local VM, but its reference is in global VM (in systemdict) and therefore not encountered during a scan of local VM roots? PLRM 3ed, p 66: Note: systemdict, a global dictionary, contains several entries whose values are local dictionaries, such as userdict and $error. This is an exception to the normal rule, described in Section 3.7.2, “Local and Global VM,” that prohibits objects in global VM from referring to objects in local VM. So, yes it's a straight exception to the rule. And for the rest, ya gotta do what you gotta do!
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.postscript
csiph-web