Concurrent access to static methods

前端 未结 6 1869
面向向阳花
面向向阳花 2020-12-14 01:45

I have a static method with the following signature:

public static List processRequest(RequestObject req){
  // process the request obje         


        
6条回答
  •  别那么骄傲
    2020-12-14 02:40

    Answering exactly your question:

    1. Method will be executed concurrently (multiple times in the same time if you have several threads).
    2. Requests will be handled concurrently.

    You need to add the synchronized modifier if you are working with objects that require concurrent access.

提交回复
热议问题