• Post Reply Bookmark Topic Watch Topic
  • New Topic

Thread modifying another thread?  RSS feed

 
H Melua
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I was reading about threads and i came across the fact we should avoid allowing a thread to modify another!

Can someone show me a very basic example of a thread trying to modify another if both threads where running inside two different classes?

Thanks
HannaH
 
Norm Radder
Rancher
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what you mean by a thread modifying another thread. What are the properties of a thread that can be modified? Is Prioity one?
Then if thread2 can get a refence to thread1 (say rThread1) then in thread2: rThread1.setPriority(value); would modify thread1.

Somehow I don't think this is what you are asking. If not, please explain.
 
H Melua
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you've got the point

I found it a bit weired when i read it which is why i asked

Thanks a lot
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!