[1585] in Coldmud discussion meeting
Re: A couple simple questions (hopefully)
daemon@ATHENA.MIT.EDU (Tue May 30 14:11:02 2000
)
Date: Tue, 30 May 2000 11:58:01 -0600
From: Brandon Gillespie <brandon@roguetrader.com>
To: coldstuff@cold.org
In-Reply-To: <200005300503.WAA07490@netcom.com>; from Steven J. Owens on Mon, May 29, 2000 at 10:03:31PM -0700
Reply-To: coldstuff@cold.org
--dDRMvlgZJXvWKvBx
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
On Mon, May 29, 2000 at 10:03:31PM -0700, Steven J. Owens wrote:
>=20
> Andy Croft asks:
> > > To clarify, I'll have a $thing I've whipped up created every time a g=
roup
> > > of players enter combat that acts as a "referee". At the end of comba=
t, the
> > > referee object is destroyed. Now, after a year of 10 to twenty players
> > > duking it out will Cold be able to handle it? Bear in mind I'm still =
new to
> > > a powerful OOP environment like Cold. Please save the diesel fuel and
> > > matches, I'm painfully aware of my incompetence with Cold. <GRIN>
>=20
> Bruce writes:=20
> > Why not just create them as needed and when done with the match, return
> > them to a pool of un-managed referee objects? That way, if you only
> > ever have 10 matches at once, you only really need to create 10 refereee
> > objects, rather than an endless cycle of create+destroy.
>=20
> Just out of curiosity, what's wrong with an endless
> create/destroy cycle? =20
>=20
> I'm mostly a spectator on the cold list, but this general topic
> gets discussed a lot in Java circles, because object instantiation is
> so expensive in Java. The general tone, though, is that creating and
> destroying would be a more elegant design, if not for the limitations
> of the language environment.
=20
Because objects are inherently persistent in ColdC, they also have a
unique identifier. This means you can theoretically run out of
identifiers since it is a signed 32bit number.
As far as overhead goes--that is more a core issue than anything. To
instantiate an object in ColdC (without hooking into the core) is
relatively lightweight--but then no initialization occurs either.
-Brandon Gillespie
--dDRMvlgZJXvWKvBx
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
MessageID: UUCbOJ7cisamEFpaEY1HaEOi9xsq+Ucj
iQA/AwUBOTQBJkv5XoQiMgn6EQK1jgCfeMItVSP3ryfwGmkil1fmeh8s+98AoMVG
zIFDFnTif5BboXDnKT233M15
=dyMo
-----END PGP SIGNATURE-----
--dDRMvlgZJXvWKvBx--