• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

hello i am mohandodderi very new member in the family

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello , if we have synchronized code/method in the middle of the statements sequence ,what will happen in multithreaded environment.how does the execution takes place ,ie if one thread executing that synchronized code/method ,what other paralally executing thread will be doing , is there any problem in the performance ,ie slowlness in the execution ...
pls help me
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mohan, welcome to Javaranch.

This particular forum is for Servlets questions. Your question on Threads should be posted in a forum that handles Thread questions, So I am going to move this thread to that forum. Please try to keep your questions on topic to the forum that will best answer your questions.

Good Luck

Mark
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The synchronized block of code can only be executed by one thread at a time. Threads not waiting to execute that block are unaffected. So make the synchronzed block as small as possible. For example, if the only data that needs to be thread safe is in an ArrayList, then synchronized block should only contain code that accesses that ArrayList - no more.
 
Rovas Kram
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


"An anology I have used before is that of a movie theater. You don't expect the movie to take longer just because a few more people come in to see it today." - Frank Carver



Mark, of what is the above quote an anology?
 
reply
    Bookmark Topic Watch Topic
  • New Topic