title: How does the singleton Bean serve the concurrent request?
body: <p>I have a question regarding how singleton beans serve concurrent requests in detail.</p>
  
  <p>I have searched on StackOverflow regarding this question. This is a sample <a href="https://stackoverflow.com/questions/13776728/how-does-spring-bean-handle-concurrency">link from stackoverflow</a>, but I found only high level details. I want full details on how a singleton bean serves concurrent requests and how the system processor will see those requests.</p>
  
  <p>I have researched regarding concurrent request handling in the system processor online. They said the processor itself has a scheduler and that scheduler will decide which request gets processed.</p>
  
  <p>Ok fine. If suppose I have more than one core processor, how does the scheduler handle concurrent requests?</p>
  
  <p>Can anyone explain to me the step-by-step process on how a singleton bean will serve concurrent requests in the JVM and system?</p>
  
  <p>Let me explain with a concrete example. I have a class like <code>Sports</code>:</p>
  
  <pre><code>class Sports {
      public void playFootball() {
      }
  
      public void playVolleyBall() {
      }
  }
  </code></pre>
  
  <p>Two requests come in. The first request is executing the <code>playFootball</code> method on the created singleton instance of class <code>Sports</code>. At the same time, another request is executing the <code>playVolleyBall</code> method on the same created singleton instance of class <code>Sports</code>.</p>
  
  <p>How is it possible with a singleton instance?</p>