Click or drag to resize

ICountDownLatch Interface

ICountDownLatch is a backed-up distributed alternative to the .

ICountDownLatch is a cluster-wide synchronization aid that allows one or more threads to wait until a set of operations being performed in other threads completes.

There are a few differences compared to the ICountDownLatch :

  1. the ICountDownLatch count can be re-set using TrySetCount(int) after a countdown has finished but not during an active count. This allows the same latch instance to be reused.
  2. there is no await() method to do an unbound wait since this is undesirable in a distributed application: it can happen that for example a cluster is split or that the master and replica's all die. So in most cases it is best to configure an explicit timeout so have the ability to deal with these situations.

Namespace:  Hazelcast.Core
Assembly:  Hazelcast.Net (in Hazelcast.Net.dll) Version: 3.12.3
Syntax
public interface ICountDownLatch : IDistributedObject

The ICountDownLatch type exposes the following members.

Methods
  NameDescription
Public methodAwait
Causes the current thread to wait until the latch has counted down to zero, an exception is thrown, or the specified waiting time elapses.
Public methodCountDown
Decrements the count of the latch, releasing all waiting threads if the count reaches zero.
Public methodDestroy
Destroys this object cluster-wide.
(Inherited from IDistributedObject.)
Public methodGetCount
Returns the current count.
Public methodGetName
Returns the unique name for this IDistributedObject.
(Inherited from IDistributedObject.)
Public methodGetPartitionKey
Returns the key of partition this IDistributedObject is assigned to.
(Inherited from IDistributedObject.)
Public methodGetServiceName
Returns the service name for this object.
(Inherited from IDistributedObject.)
Public methodTrySetCount
Sets the count to the given value if the current count is zero.
Top
See Also