4. Main method of synchronisation

Shared memory based Synchronization

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.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

友情链接更多精彩内容