Thanatos

A Garbage Collection technique for Object Oriented programming in TCL. Most (if not all) TCL object systems do not contain a native garbage collection process. Many large applications create a large number of temporary objects (mortals). Keeping them in memory leads to needless consumption of resources. Constantly re-spawning them can lead to significant performance penalties in some object systems.

Thanatos was developed by SDW for use in his Odie system.

Thanatos has 3 parts

  • The Book of the Dead
  • The Pale Rider
  • The Kiss of Death

The Book of the Dead

The Book of the Dead is a process by which all mortals register with the Pale Rider on creation. This is usually a line on the constructor method that adds the object's name to a large list.

The Pale Rider

The Pale Rider is a task that periodically runs through the list of mortals. It asks them if they are busy, and if they are not, it gives them the Kiss of Death. Running the task on a periodic schedule is usually accomplished with a Lotus Blossum Loop.

The Kiss of Death

A method built into mortals that tells them to give up their toys and terminate.

Example Code:


Category Dev. Tools