ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From luqmanahmad <luqmanah...@gmail.com>
Subject multiple thread access in segment resolver
Date Tue, 18 Jul 2017 10:18:29 GMT
Hi all,

Let say we have a segmentation resolver named
"ApplicationSegmentationResolver" which is checking about the statuses of
different applications but it needs to be initialised first time. For
example something like this:

public ApplicationSegmentationResolver implements SegmentationResolver {

Object status;

public boolean isValidSegment() throws IgniteCheckedException {

if (status == null) {
status = new Object();
// do some other stuff which needs to be initialised once



In the above scenario can multiple threads access this segmentation resolver
at the same time and see the status to null ? I am not sure how the
internals are working for segmentation resolver and is not clear from the
SegmentationResolver docs either, but if multiple threads can access it at
the same time is it a good thing to provide some kind of synchronisation ?
So that other threads can wait while it is being initialised ?   


View this message in context: http://apache-ignite-users.70518.x6.nabble.com/multiple-thread-access-in-segment-resolver-tp15049.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

View raw message