CVSROOT:        /cvs/directfb
Module name:    DirectFB
Changes by:     dok     20030710 02:17:35

Modified files:
        src/core       : input.c 
        src/core/fusion: object.c object.h ref.c ref.h 

Log message:
Drop bone collector threads completely, which have been three per session.

Use new fusion_ref_watch() instead of creating a bone collector thread for each
object pool where each thread polled all references ten times per second:

1) Create a FusionCall in fusion_object_pool_create() with the pool being the
call context pointer.

2) Call fusion_ref_watch() in fusion_object_create() after increasing the
reference counter to one. Specify the call created with the pool, pass the
object id as the call argument.

When the call handler is executed (in the pool owner's messaging thread) upon
zero reference, it gets its pointer to the pool (call context) and the id of
the object (call argument). The handler looks for this id and calls the object
destructor if the id has been found and the reference counter is still zero.

This has several advantages for single and multi app core:

- Removed three threads from master (window, surface and palette pool).
- No more polling of each object's reference counter ten times per second.
- Objects are destructed nearly immediately (even a direct call in single app).
- Less shutdown time (100-200 ms or more waiting for sleeping bone collectors).

The same applies to FusionSound with two object pools (buffer and playback).

Commented out debug message for key events.



-- 
Info:  To unsubscribe send a mail to [EMAIL PROTECTED] with 
"unsubscribe directfb-cvs" as subject.

Reply via email to