Reference objects and simultaneous calls

  • Thread starter Thread starter gs_sarge
  • Start date Start date
G

gs_sarge

Hi:

I'm not too clear on how method calls are handled by referenced
objects.

If an object is referenced in two different places and a call to the
same method is called by both relatively quickly, are different
threads spawn for each caller's method call, or is it a single thread?

thanks for info in advance

Steve
 
Steve,
If an object is referenced in two different places and a call to the
same method is called by both relatively quickly, are different
threads spawn for each caller's method call, or is it a single thread?

No threads are spawned when you call a method. The called method
executes on the same thread as the caller.



Mattias
 
You say on the same thread as the caller. In other words, they are in
different threads; threads on the callers side. Am I understanding
that correctly?
 
You say on the same thread as the caller. In other words, they are in
different threads; threads on the callers side. Am I understanding
that correctly?

Sounds like it, yes (though I'm not sure what "they" are referring
to).



Mattias
 
"They" would be referring to the call on the same method from
different callers who share the same reference to the object on which
they are calling the method.

Thanks for info.
 
Back
Top