This file contains 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
// Jeff Preshing's example that shows the reordering of Intel CPUs made to | |
// work on both Linux and macOS. | |
// | |
// Original source: | |
// | |
// https://preshing.com/20120515/memory-reordering-caught-in-the-act/ | |
// | |
// Apple semaphore change is based on the answer by dho at: | |
// | |
// https://stackoverflow.com/questions/27736618/why-are-sem-init-sem-getvalue-sem-destroy-deprecated-on-mac-os-x-and-w |
This file contains 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
# Inspired by https://gist.github.com/harel/9ced5ed51b97a084dec71b9595565a71 | |
from collections import namedtuple | |
import functools | |
import json | |
import six | |
Serialized = namedtuple('Serialized', 'json') | |