WeakArray.st
changeset 2145 d243ffafeae3
parent 2091 c11bb3e29a1b
child 2186 a82449c022fc
equal deleted inserted replaced
2144:76dd062d32a1 2145:d243ffafeae3
     7  inclusion of the above copyright notice.   This software may not
     7  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 
       
    13 'From Smalltalk/X, Version:3.1.3 on 7-jan-1997 at 17:23:10'                     !
       
    14 
    12 
    15 Array subclass:#WeakArray
    13 Array subclass:#WeakArray
    16 	instanceVariableNames:'dependents'
    14 	instanceVariableNames:'dependents'
    17 	classVariableNames:'RegistrationFailedSignal AlreadyInitialized'
    15 	classVariableNames:'RegistrationFailedSignal AlreadyInitialized'
    18 	poolDictionaries:''
    16 	poolDictionaries:''
    69     Also, as a side effect, it is possible to delay finalization by blocking 
    67     Also, as a side effect, it is possible to delay finalization by blocking 
    70     interrupts.
    68     interrupts.
    71 
    69 
    72     A weakArray notifies its dependents via normal dependency notfications.
    70     A weakArray notifies its dependents via normal dependency notfications.
    73 
    71 
    74     NOTICE: 
    72     [hint:] 
    75         WeakArray handling adds some overhead to the VM 
    73         WeakArray handling adds small some overhead to the VM 
    76         (each weakarray is scanned after each GC). 
    74         (each weakarray is scanned after each GC). 
    77         It is uncertain, if the current mechanism works well
    75         It is uncertain, if the current mechanism works well
    78         with (say) ten-thousands of weakArrays.
    76         with (say) ten-thousands of weakArrays.
    79 
    77         We had the system running with >2000 weakArrays, some being quite
       
    78         big for a while and had a few percent of added gc time.
       
    79         The system as delivered creates between 50 and 100 weakArrays,
       
    80         but with many dependents, this number may grow.
       
    81         If you need the dependency mechanism on a huge number of objects,
       
    82         consider adding a (non-weak) dependents field to your class
       
    83         - take the implementation of Model as a guide (or subclass them
       
    84         from Model).
       
    85 
       
    86                                                                                 \
    80     As a possible option, we could perform the weakArray scanning only in
    87     As a possible option, we could perform the weakArray scanning only in
    81     the oldSpace reclamation code - this would remove most of the overhead,
    88     the oldSpace reclamation code - this would remove most of the overhead,
    82     but will lead to much longer delayed finalization .... we will see.
    89     but will lead to much longer delayed finalization .... we will see.
    83 
    90 
    84 
    91 
    98 
   105 
    99     [author:]
   106     [author:]
   100         Claus Gittinger
   107         Claus Gittinger
   101 
   108 
   102     [See also:]
   109     [See also:]
   103         Array WeakIdentitySet WeakIdentityDictionary
   110         Array WeakIdentitySet WeakIdentityDictionary Registry
       
   111         Model
   104 "
   112 "
   105 ! !
   113 ! !
   106 
   114 
   107 !WeakArray class methodsFor:'initialization'!
   115 !WeakArray class methodsFor:'initialization'!
   108 
   116 
   626 ! !
   634 ! !
   627 
   635 
   628 !WeakArray class methodsFor:'documentation'!
   636 !WeakArray class methodsFor:'documentation'!
   629 
   637 
   630 version
   638 version
   631     ^ '$Header: /cvs/stx/stx/libbasic/WeakArray.st,v 1.37 1997-01-08 19:42:14 stefan Exp $'
   639     ^ '$Header: /cvs/stx/stx/libbasic/WeakArray.st,v 1.38 1997-01-11 12:13:33 cg Exp $'
   632 ! !
   640 ! !
   633 WeakArray initialize!
   641 WeakArray initialize!