Class SpaceOperationsCoordinator
java.lang.Object
com.gigaspaces.internal.server.space.SpaceOperationsCoordinator
Coordinates execution of Concurrent and Critical space operations: - While a critical operation
is executing, any other incoming operation is blocked until the critical operation is finished. -
While a concurrent operation is executing, incoming concurrent operations are not blocked, but
critical operations are blocked until all running concurrent operations are finished. Requests
for concurrent operations which arrive after while there's a pending critical operations are
blocked and scheduled afterwards, to avoid starvation of critical operations.
- Since:
- 8.0
- Author:
- Niv Ingberg
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidBegins a concurrent operation.voidBegins a exclusive operation.voidEnds a concurrent operation which was previously started viabeginConcurrentOperation().voidEnds a exclusive operation which was previously started viabeginExclusiveOperation().
-
Constructor Details
-
SpaceOperationsCoordinator
public SpaceOperationsCoordinator(int numOfSegments)
-
-
Method Details
-
beginConcurrentOperation
public void beginConcurrentOperation()Begins a concurrent operation. If a exclusive operation is in progress (i.e.beginExclusiveOperation()was called butendExclusiveOperation()was not called yet), invocation is blocked until the exclusive operation is finished. Blocking management is fair, i.e. ifbeginExclusiveOperation()was invoked and blocked, subsequent calls tobeginConcurrentOperation()will be blocked as well and will be scheduled after the exclusive operation. It is the responsibility of the caller to callendConcurrentOperation()when the operation is finished. -
endConcurrentOperation
public void endConcurrentOperation()Ends a concurrent operation which was previously started viabeginConcurrentOperation(). -
beginExclusiveOperation
public void beginExclusiveOperation()Begins a exclusive operation. If one or more concurrent operations are in progress (i.e.beginConcurrentOperation()was called butendConcurrentOperation()was not called yet), invocation is blocked until all concurrent operations are finished. Blocking management is fair, i.e. ifbeginExclusiveOperation()was invoked and blocked, subsequent calls tobeginConcurrentOperation()will be blocked as well and will be scheduled after the exclusive operation. It is the responsibility of the caller to callendConcurrentOperation()when the operation is finished. -
endExclusiveOperation
public void endExclusiveOperation()Ends a exclusive operation which was previously started viabeginExclusiveOperation().
-