Thanks for the reply.

If I make the resources thread safe, will the subsequent requests to the
service be queued or ignite spawns a new service, or load balances,
assuming that I deploy the service with node singleton or affinity option?

On Mon, Apr 6, 2020 at 2:28 PM akorensh <[email protected]> wrote:

> Hi,
>
> If you structure your code such that each request is accessing a global
> resource that needs to be protected
>
> i.e. your service has a get(..) method which accesses a regular HashMap,
> then yes that HashMap needs to be protected.
>
> If you structured your service to use concurrent structures -- Ignite Maps,
> or concurrent HashMaps then you are ok.
>
> See this example:https://apacheignite.readme.io/docs/service-example
> Here all data is stored in Ignite Cache and therefore threadsafe.
> (If you were to replace the IgntieCache with a HashMap then the code in
> get/set would need to use locks/synchronized sections)
>
> Thanks, Alex
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Reply via email to