- Proactor
- Proactor vs Reactor
- The Reactor patterns involve synchronous I/O, whereas the Proactor pattern involves asynchronous I/O. In Reactor, the event demultiplexor waits for events that indicate when a file descriptor or socket is ready for a read or write operation. The demultiplexor passes this event to the appropriate handler, which is responsible for performing the actual read or write.
- In the Proactor pattern, by contrast, the handler—or the event demultiplexor on behalf of the handler—initiates asynchronous read and write operations. The I/O operation itself is performed by the operating system (OS). The parameters passed to the OS include the addresses of user-defined data buffers from which the OS gets data to write, or to which the OS puts data read. The event demultiplexor waits for events t
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// InflatableSeqLock | |
// Copyright(C) 2016 Oracle and/or its affiliates | |
// Dave Dice : https://blogs.oracle.com/dave | |
// | |
// Remarks: | |
// * Implements composite writer mutex and seqlock in a single word-sized lock. | |
// Allows optimistic reading and pessimistic writing. | |
// Readers don't write to shared synchronization metadata, which helps avoid | |
// coherence traffic. Readers must tolerate observing inconsistent state, however. | |
// * Writer mutex is based on LIFO-CR lock from http://arxiv.org/abs/1511.06035. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Build: g++ -O3 -std=gnu++14 -m64 MonoTime.cc -lpthread -o MonoTime -mmemory-model=tso | |
// | |
// Dave Dice -- blogs.oracle.com/dave | |
#include <thread> | |
#include <chrono> | |
#include <iostream> | |
#include <vector> | |
#include <mutex> | |
#include <random> |
OlderNewer