Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2006

Tip: Looking for answers? Try searching our database.

What is the relationship between a thread of execution and an object?

Thread view: 
rubikzube* - 22 May 2006 21:54 GMT
If I have an object that has been initialized in one thread of
execution, and I create another thread of execution that calls a method
on that object, does that method execute in the first thread of
execution?

Based on initial observations of thread behavior in an application I am
developing, it does.  I'm just looking for some clarification.
VisionSet - 22 May 2006 22:56 GMT
> If I have an object that has been initialized in one thread of
> execution, and I create another thread of execution that calls a method
[quoted text clipped - 3 lines]
> Based on initial observations of thread behavior in an application I am
> developing, it does.  I'm just looking for some clarification.

When you call a method from a thread, it executes in that thread period.
So with you example, no, the 2nd thread.

--
Mike W
jmcgill - 22 May 2006 23:03 GMT
> Based on initial observations of thread behavior in an application I am
> developing, it does.  I'm just looking for some clarification.

I think you may be misinterpreting your observations.
rubikzube* - 22 May 2006 23:15 GMT
I must be... Hmm.  Thanks for the reply.  I'm going to go back and take
a closer look at what is going on.
rubikzube* - 23 May 2006 08:46 GMT
Aha!  I was calling thread.run() instead of thread.start().  Thank you
for your help.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.