• Post Reply Bookmark Topic Watch Topic
  • New Topic

Context scope attributes. Thread safety.

 
Rohit Kelkar
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any way that the context attributes can be made thread safe?
 
Stefan Zoerner
Author
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make all attributes private and synchronize the accessor methods etc. to it via modifier.
I think it should work the same way as in standard Java.
Greetings from Hamburg,
Stefan
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!