Re: Static Methods in DAO

From: Josh Martin (josh.martin_at_gmail.com)
Date: 07/21/04


Date: 21 Jul 2004 05:31:38 -0700

Thank you for the answer. Quick question - if there are shared static
methods, or a single shared object (i.e. singleton), how can multiple
threads make use of the same method simultaneously? Again, apologies
for being a bit uninformed regarding threading, but in my mind, the
only way to allow multiple threads simultaneous access to methods
would be to have more than one instance of them. Otherwise, it seems
like all threads would be vying for the same method - though it would
certainly work.

I think the answer to this question would probably clarify things for
me: Is it possible for multiple threads to execute the same line of
code in a method at the exact same time if there is one shared object
(singleton) or it is a static method? Thanks again!



Relevant Pages

  • Re: Global variables
    ... > (generally from external file), that need to be shared in the application. ... I think using Singleton may be a different issue. ... the behavior doing the creating may be invoked multiple times. ... sending emails before I speculate on where to glue the SMTP server ...
    (comp.object)
  • Re: Utility classes?
    ... I don't want to duplicate code in multiple places. ... > (singleton) classes created to encapsulate related operations in one class. ...
    (comp.lang.cpp)
  • Re: Singleton Pattern
    ... one should /only/ use Singleton when the problem solution has multiple paths that could lead to violating the problem space referential integrity requirement in. ...
    (comp.object)
  • Re: Static Methods in DAO
    ... "Josh Martin" wrote in message ... > methods, or a single shared object (i.e. singleton), how can multiple ... > only way to allow multiple threads simultaneous access to methods ...
    (comp.lang.java.programmer)
  • Re: Thread-safe Collection
    ... but after that it would only be supporting multiple readers. ... I wanted the dictionary items in a common memory store (to avoid ... If you pin a singleton somewhere, ... If you want to have fast parallel reads from multiple STAs, ...
    (microsoft.public.vb.com)