Results 1 to 3 of 3
  1. #1
    reddi.java97 is offline Member
    Join Date
    Sep 2013
    Posts
    2
    Rep Power
    0

    Post how to share same object to multipule threads ?

    how we can share same object to multipule threads ?

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,932
    Rep Power
    8

    Default Re: how to share same object to multipule threads ?

    What have you tried? What difficulty are you experiencing? What are you confused about? Where is your SSCCE?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,877
    Rep Power
    5

    Default Re: how to share same object to multipule threads ?

    Quote Originally Posted by reddi.java97 View Post
    how we can share same object to multipule threads ?
    ... the same way as you do with regular classes. You pass references around through either constructors or setter methods.

    Are you perhaps looking for how to access the same objects SAFELY in multiple threads, without conflicts? Because then you're looking for the concurrency tutorial.

    Lesson: Concurrency (The Javaô Tutorials > Essential Classes)

    I ask because if you have to ask how to pass around object references, you are nowhere near ready to touch threads yet.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Threads per Connection or Threads per Request
    By Felic in forum New To Java
    Replies: 4
    Last Post: 11-22-2011, 09:15 PM
  2. share session object between servlet and jsp
    By sameerk in forum Java Servlet
    Replies: 6
    Last Post: 09-29-2010, 10:20 AM
  3. How to synchronize threads on an object
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-09-2008, 06:39 PM
  4. Got an Idea, Just Share it!
    By james in forum Java Software
    Replies: 0
    Last Post: 03-18-2008, 12:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •