Results 1 to 3 of 3
Thread: Threading issue
- 09-18-2008, 10:41 AM #1
Senior Member
- Join Date
- May 2008
- Location
- Makati, Philippines
- Posts
- 234
- Rep Power
- 6
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.
- 09-18-2008, 10:44 AM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
Don't use any instance variables.
- 09-18-2008, 10:47 AM #3
Senior Member
- Join Date
- May 2008
- Location
- Makati, Philippines
- Posts
- 234
- Rep Power
- 6
Similar Threads
-
Threading in EJB
By java08 in forum Advanced JavaReplies: 2Last Post: 08-12-2008, 11:09 AM -
Threading a method
By Sephirangel in forum Threads and SynchronizationReplies: 3Last Post: 05-05-2008, 07:38 AM -
Java threading
By Eranga in forum Advanced JavaReplies: 2Last Post: 03-13-2008, 05:30 AM -
Threading prob..
By banie in forum Java AppletsReplies: 0Last Post: 02-05-2008, 06:30 AM -
question about Multi threading in Java
By fred in forum Advanced JavaReplies: 1Last Post: 07-24-2007, 01:55 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks