thoughts on a real-time core for gephex-0.5

Georg Seidel <[email protected]> Tue, 28 Jun 2005 19:28:41 +0200
Newsgroups gmane.comp.video.gephex.devel
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

a few weeks ago, I had a discussion with Martin about a mechanism to 
make the
gephex-0.5 core independent of the potentially blocking operations from 
the scripting
language thread. (E.g. creating and deleting new units and links, 
connecting them, ...)

The result was probably the following idea (cannot remember exactly,
but this seems to make sense):
Every unit, link, and connection (= core object) has two additional 
flags:
   "inactive" and "deactivate"

When  a new core object is created, both flags are not set.
The scripting language thread may only change the "deactivate" flag, 
the core thread only
changes the "inactive" flag.

The scripting language thread must not delete objects if the "inactive" 
flag is not set.

To delete an object, the scripting language must set the "deactivate" 
flag and
wait until the core answers by setting the "inactive" flag. Then it is 
safe to delete
the object (because the core will ignore objects marked as inactive).

Additionally,  objects must be created in the scripting language 
thread, because
memory allocation can potentially take a long time.


Regards,

Georg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Darwin)

iD8DBQFCwYjM/rP0cdKF/ToRAhdQAJ9qj+9n01hSK8O/VSoZPlVb0ZPT1ACglM9z
IxoNW9yo3k5PFuwxMv2H+u4=
=tbxs
-----END PGP SIGNATURE-----