lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On Friday, November 1, 2002, at 12:32  PM, Steve Dekorte wrote:


On Friday, November 1, 2002, at 12:21 PM, James McCartney wrote:
On Thursday, October 31, 2002, at 03:59  PM, Steve Dekorte wrote:
so only the freed objects are touched on a sweep.

Just to press the point, with Baker's treadmill you don't even have to do that.

I just made a small change to make the definitions of black and white dynamic that avoids it. Maybe this is equivalent to "Baker's treadmill"? The descriptions I've read of it weren't very clear to me.


With the treadmill you've got linked lists of grey, black, white and free. To scan an object you remove it from the grey list to black and put all of the objects it points to onto the grey list. Once the grey list is exhausted then everything on the white list is not live and so the entire white list can be linked onto the free list. This requires changing 6 list pointers. Then you change the meaning of the color bits so that black now means white and start over.

With a treadmill, since there is no sweep then there is not a built in way to do finalization. There are ways to get around it, such as using a separate treadmill for finalizable objects and sweeping that one. I used that for a while, but decided to it would be better for real time performance to avoid finalization altogether. Instead I put things that need to be finalized onto a known live list (e.g. 'allOpenFiles') to keep them live until I manually close them.

--
--- james mccartney   james@audiosynth.com   <http://www.audiosynth.com>
SuperCollider - a real time synthesis programming language for the PowerMac.
<ftp://www.audiosynth.com/pub/updates/SC2.2.16.sea.hqx>