On Thu, Feb 01, 2001 at 09:39:39AM -0800, Daniel Rall wrote:
> > Added a static method getFieldNames() generated from Object.vm.
> > It returns a Vector with the field names; these names can later
> > be used as input for getByName(). Note: this method uses a
> > private static variable, and there might be MT concerns here,
> > since no locking is used at all.
>
> Torque is currently setup to be run as an Ant task from the command
> line, with only one thread involved (i.e. we're okay for now). Good
> to note for future changes or weird setups. ;)
Ah, but what Gonzalo is saying here is that the code /generated/ has MT
issues, and that code is OM code for use by Turbine itself.
So Gonzalo, you need to make getFieldNames() a synchronized method,
other than it's okay because the Vector is intended to be read only, and
anyway Vector is a threadsafe class. If it were not for Jon's recent
posting regarding the unsafety of double-checked locking you could use
that to prevent the synchronization overhead after the first call. Alas
though this optimisation is to be no more... :-(
--
Sean Legassick
[EMAIL PROTECTED]
Soy un hombre: nada humano me es extrano
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]