Results 1 to 3 of 3

Thread: Threading issue

  1. #1
    Eku
    Eku is offline Senior Member
    Join Date
    May 2008
    Location
    Makati, Philippines
    Posts
    234
    Rep Power
    7

    Question Threading issue

    Hello guys,

    I just post here to ask some idea or opinion to start with ^_^

    I have a jsp and a servlet. typically my jsp is the gui and contains the validations so there is no problem with that. In servlet i have the process and call some java class as batch process and they work in harmony for the case that there is only one user that is currently working on it.

    By nature, servlet are multi threaded rigth? Can you give me a hint of idea how to make a stop light to prevent overwriting of variables if 2 or more users are using the system. =) And based from what ive read single threading is not an option and i dont want to create a new code.

    In my case it is Ok to create a stop light like when someone tries to access that class when some is still using it the system would make that user with until it is free. It will make my system feel some bottle neck effect but the users are controlled so it wont matter much (around 1-5 users only and the processing is by request).

    Thanks a lot ^_^
    Mind only knows what lies near the heart, it alone sees the depth of the soul.

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Don't use any instance variables.

  3. #3
    Eku
    Eku is offline Senior Member
    Join Date
    May 2008
    Location
    Makati, Philippines
    Posts
    234
    Rep Power
    7

    Default

    yup im trying to avoid using instances variables. So i just want to implement somekind of Stop ligth. preventing a another user or something like letting one user at a time access a servlet =)
    Mind only knows what lies near the heart, it alone sees the depth of the soul.

Similar Threads

  1. Threading in EJB
    By java08 in forum Advanced Java
    Replies: 2
    Last Post: 08-12-2008, 12:09 PM
  2. Threading a method
    By Sephirangel in forum Threads and Synchronization
    Replies: 3
    Last Post: 05-05-2008, 08:38 AM
  3. Java threading
    By Eranga in forum Advanced Java
    Replies: 2
    Last Post: 03-13-2008, 06:30 AM
  4. Threading prob..
    By banie in forum Java Applets
    Replies: 0
    Last Post: 02-05-2008, 07:30 AM
  5. question about Multi threading in Java
    By fred in forum Advanced Java
    Replies: 1
    Last Post: 07-24-2007, 02:55 AM

Posting Permissions

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