4. Main method of synchronisation

Shared memory based Synchronization

4. Main method of synchronisation_第1张图片
lecture note

Java

  1. mutual exclusion available.
  2. mixture of high-level object oriented feature and low concurrency primitives.
  3. General notification feature.

Ada

  1. has high-level synchronization support (projected object) which scales to large size of project.
  2. Full compiler support(potential dead lock analysis)
  3. Low-level semaphore for very special use.

High performance Computing(HPC)

  1. keep cpu as busy as possible.
  2. Avoid contention on spare resources.
  3. Data is assigned to individual process rather than process synchronizing on data.
  4. the Data integrity is achieved by keeping the CPU nodes in approximate "lock- step", but we still need to re-sync concurrent entities.

Synchronization Model(Message-based synchronization)

Synchronous

  1. Sender waiting
  2. Receiver waiting

Until another side is available and another side acknowledge to finish it.
Simulated by asynchronous:

  1. both process suspend themselves until the transaction is completed.
  2. as there is no immediate communication takes place, the process will never actually synchronized.
  3. the sender process know when it is finished.

Asynchronous

  1. Message is not transferred directly.
  2. A buffer is required to store the messages.
  3. care about the buffer overflow and buffer size.

Simulated by synchronous message

  1. intermedia is able to accept message at all times.
  2. intermedia also need to send message out on request.

Remote invocation

  1. delay the sender or receiver until the first rendezvous point.
  2. pass parameters.
  3. keep the sender blocked until the receiver finished its own process.
  4. pass result
  5. release both process

Simulate by asynchronous messages:only need to simulate 2 synchronous messages.

Remote invocation(No results)
Shorter form of Remote invocation which does not wait for results to be passed back.
Both Remote invocations are actually synchronized at the time of invocation.

Simulate by asynchronous messages:only need to simulate 1 synchronous messages.

Summary
If we want to simulate the Synchronization: use synchronous message and remote invocation.
or our purpose is to last message only then we use the Asynchronous message.

Communication model
one to one: buffer, queue, synchronization
one to many: multicast
one to all: broadcast
many to one: local server, synchronization
all to one: general server, synchronization
many to many: general-network or bus-system


Ada supports remote invocations in form of : entry point in the tasks and full set of parameter profiles supported.
rendezvous:2 tasks synchronized at the beginning of the remote invocation.

extended rendezvous:the calling task block is blocked until the remote routine is finished.

About the task entry

  1. task entry can call other blocking operations.(protected entry can't)
  2. "count" is defined but only inside of the task which has the entry.
  3. entry family and private entry is supported.

the difference between entry in the protected object and task is the fairness.

你可能感兴趣的:(4. Main method of synchronisation)