[haXe] Neko threads and reflection

Nicolas Cannasse ncannasse at motion-twin.com
Fri Nov 3 18:04:54 CET 2006


> Hello list,
> 
>   I've just tried to use the recently introduced thread support in
>   Neko, and found quite a weird issue:

I was afraid of this one happenning one day, but that was a lot more
quick that expected... :)

The explanation is pretty simple : the object tables contains only
fields ids which are hashed version of the field string. It is then
needed to have a reverse table to turn back a field id into a string.
This table is not stored in the VM itself, but in a per-thread global
variable. When creating a new thread, this table is empty so we can't
reverse the fields ids, unless we have already accessed it using
Reflect.field(o,"name").

That's pretty tricky and maybe it would be actually better to have this
reverse table being a real global value. That would need some
modifications to Neko.

Nicolas



More information about the Haxe mailing list