[haXe] Neko threads and reflection

Michael Pliskin pl at tepkom.ru
Fri Nov 3 18:20:04 CET 2006


Hello Nicolas,

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

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

  Ok I understand the problem, but why doesn't it happen for the
  'main' thread? How is the table initialized?

  Actually I found the problem thanks to Serializer not working
  properly - maybe there is a way to make it work without using the
  table (hmm... but not sure how). But the workaround to do a
  Reflect.field for every field is pretty ok for me now, so the
  problem is not that urgent anymore, thanks a lot.

-- 
Best regards,
 Michael                            mailto:pl at tepkom.ru




More information about the Haxe mailing list