Ephemeron

Ephemeron

:"For other uses, see Ephemera (disambiguation).In computer science, Finalization occurs when a garbage collector (GC) informs an application that an object is "almost collectable." It is used to help an application maintain its invariants. To make finalization more useful, "almost collectable" is defined in terms of a new class of objects, called ephemerons. Ephemerons are similar to weak pairs, but an object in an ephemeron's key field may be classed as "almost collectable" even if it is reachable from the epehemeron's value fields.

Description

An Ephemeron is an object which refers strongly to its contents as long as the Ephemeron's key is not garbage collected, and weakly from then on. Ephemerons solve a problem which is commonly found when trying to "attach" properties to objects by using a registry. When some property should be attached to an object, the property should (in terms of GC behavior) typically have the life-time that an instance variable of this object would have. However, this is complicated by having an external association between the object and its property such as:

property --------- registry --------- association --------- object

Here, the registry (a third party) will hold onto the association itself which would require manual removal from the registry (instead of automated garbage collection). While this problem can be always be solved in any given concrete situation by using one of the various weak association types, choosing the 'right' kind of association depends on a variety of factors some of which can change dynamically.

Ephemerons solve this problem by defining that the 'contents' (value) of an Ephemeron will be held strongly until the key is known to be garbage collected. From then on, the contents of the ephemeron will be held weakly. Therefore, the contents of an ephemeron can only become eligible for garbage collection if and only if the key is garbage collectable which is the exact behavior which we would observe for an instance variable of the object.

History

Ephemerons were first invented by Geroge Bosworth while he worked at Digitalk. They were used as the finalization mechanism in Visual Smalltalk Enterprise. Today Ephemerons are available in most Smalltalk dialects as well as many other languages with automatic garbage collection.

External links

* [http://portal.acm.org/citation.cfm?id=263733&coll=portal&dl=ACM&CFID=26736578&CFTOKEN=29568682 Ephemerons: a new finalization mechanism]


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • ephemeron — 1620s, from Gk. (zoon) ephemeron, neut. of ephemeros (see EPHEMERA (Cf. ephemera)). Figurative use by 1771 …   Etymology dictionary

  • ephemeron — [e fem′ər än΄, e fem′ərən; ifem′ər ən] n. pl. ephemera [i fem′ərə] or ephemerons [Gr ephēmeron, short lived insect < ephēmeros, for the day, short lived < epi , upon + hēmera, day] MAYFLY …   English World dictionary

  • Ephemeron — E*phem e*ron, n.; pl. {Ephemera}. [NL. See {Ephemera}.] (Zo[ o]l.) One of the ephemeral flies. [1913 Webster] …   The Collaborative International Dictionary of English

  • ephemeron — /i fem euh ron , euhr euhn/, n., pl. ephemera / euhr euh/, ephemerons. 1. anything short lived or ephemeral. 2. ephemera, items designed to be useful or important for only a short time, esp. pamphlets, notices, tickets, etc. [1570 80; < Gk… …   Universalium

  • ephemeron — e•phem•er•on [[t]ɪˈfɛm əˌrɒn, ər ən[/t]] n. pl. er•a [[t] ər ə[/t]] er•ons anything short lived or ephemeral • Etymology: 1570–80; < Gk ephḗmeron short lived insect, n. use of neut. of ephḗmeros; see ephemeral …   From formal English to slang

  • ephemeron — noun something short lived or transitory See Also: ephemeral, ephemeric …   Wiktionary

  • ephemeron — e phem·er·on || rÉ’n n. something that passes; something that is not of interest anymore (i.e. printed information) …   English contemporary dictionary

  • ephemeron — ephem·er·on …   English syllables

  • ephemeron — /əˈfɛmərən/ (say uh femuhruhn), /i / (say ee ) noun (plural ephemera /əˈfɛmərə/ (say uh femuhruh), /i / (say ee ) or ephemerons) anything short lived or ephemeral. {Greek: a short lived insect. See ephemera} …  

  • ephemeron —   n. (pl. ra) thing, especially insect, living for a day only.    ♦ ephemeral,    ♦ ephemerous, a. short lived.    ♦ ephemerid, n. may fly.    ♦ ephemeris, n. (pl.    ♦ rides, almanac showing daily positions of heavenly bodies …   Dictionary of difficult words

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”