| Title | MPS cannot queue a message when a weak thing goes away |
| Status | closed |
| Priority | optional |
| Assigned user | Gareth Rees |
| Organization | Ravenbrook |
| Description | MPS cannot queue a message when a weak thing goes away. There should be option to queue a message. See customer request [1]. |
| Analysis | See [2] for analysis from RB. GDR 2013-03-08: It looks to me as though this is not a problem any more. In the current implementation of weakness, you can detect the splatting of a weak reference by looking in the scan method to see if the reference became NULL when you fixed it. See the example in the documentation [3]. This is likely to be timelier than waiting for a message on the message queue. If you absolutely insist on using messages, you can pair your weak reference with a strong reference to a finalizable object, and then when you detect that the weak reference has been splatted, then you null out the corresponding strong reference, which will (eventually) cause a finalization message to be sent. |
| How found | customer |
| Evidence | [1] <http://info.ravenbrook.com/mail/2005/02/28/12-40-49/0.txt>[2] < http://info.ravenbrook.com/mail/2005/04/05/13-33-11/0.txt>[3] < http://info.ravenbrook.com/project/mps/master/manual/html/topic/weak.html> |
| Observed in | 1.105.0 |
| Created by | Richard Kistruck |
| Created on | 2005-03-10 03:11:45 |
| Last modified by | Richard Brooksby |
| Last modified on | 2013-03-12 12:50:35 |
| History | 2005-03-10 RHSK Created. 2005-04-05 RB Added reference to notes from analysis session. 2013-03-08 GDR More analysis. |
| Change | Effect | Date | User | Description |
|---|---|---|---|---|
| 180202 | closed | 2012-10-31 17:45:35 | Gareth Rees | Write weak references chapter. |