On Thursday, July 25, 2002, at 05:26  PM, Ned Konz wrote:

> On Thursday 25 July 2002 02:06 pm, David King Landrith wrote:
>> 1.  The class is used by a terminal program that will be run on one
>> machine by multiple people with ssh connections to that machine.
>> 2.  The class should never be instantiated more than once on the
>> machine, regardless of how many people are running the program that
>> uses it.

> If this is more than one Ruby program, you'll have to do inter-process
> communications of some sort. Doesn't this make the job of having a
> singleton easy? (i.e. only one program on a machine can be accepting
> connections on a given port).

This is the same program being run twice concurrently, but from what you 
say it sounds like this may be equivalent to two separate programs.  I'd 
like to protect the resources that the program uses, and I was hoping 
that using a singleton class to access the resources would ensure this 
(rather than writing and debugging my own mutex stuff).

> The Singleton support (as all class/object based programming in a
> non-distributed Ruby system) only deals with a single Ruby process.

That's what I was afraid of.

-------------------------------------------------------------
David King Landrith v) 617-227-4469x212

One useless man is a disgrace, two are called a law firm,
and three or more become a congress -- John Adams
-------------------------------------------------------------
public key available upon request