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
#ifndef PATOMIC_PATOMIC_H | |
#define PATOMIC_PATOMIC_H | |
#include <stddef.h> | |
#include <patomic/types/align.h> | |
#include <patomic/types/feature_check.h> | |
#include <patomic/types/ids.h> | |
#include <patomic/types/ops.h> | |
#include <patomic/types/memory_order.h> |
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
#include <cstddef> | |
#include <iterator> | |
#include <memory> | |
#include <type_traits> | |
template <class T, class Derived, bool is_const> | |
requires std::is_object_v<T> | |
class random_access_iterator_crtp | |
{ |
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
#define PY_SSIZE_T_CLEAN | |
#include <Python.h> | |
#include <errno.h> | |
#include <stdatomic.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <sys/eventfd.h> | |
#include <unistd.h> |
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
class CombinedLoopSemaphore: | |
__slots__ = ("_sync_sem", "_async_lock", "_sleep_period") | |
def __init__(self, value: int = 1, process_shared: bool = False, sleep_period: float = 0.01): | |
# could potentially accept an external semaphore as a param here too? | |
# should process_shared be stored as an attribute? | |
# we delegate validating `value` to the chosen semaphore implementation | |
self._sync_sem = multiprocessing.Semaphore(value) if process_shared else threading.Semaphore(value) | |
self._async_lock = asyncio.Lock() |
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
import asyncio | |
import time | |
class CombinedLock: | |
def __init__(self, sync_lock, async_lock) -> None: | |
self.__sync_lock = sync_lock | |
self.__async_lock = async_lock | |
self.__is_locked = False |
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
#ifndef HTTP_GET_HPP | |
#define HTTP_GET_HPP | |
#include <netdb.h> | |
#include <netinet/in.h> | |
#include <netinet/tcp.h> | |
#include <sys/socket.h> | |
#include <unistd.h> | |
#include <algorithm> |
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
#include <concepts> | |
#include <iterator> | |
namespace binary::concepts { | |
/* | |
* BINARY | |
* ------ | |
* | |
* Explicitly Supported Types: |
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
namespace io::concepts { | |
/* | |
* Concept Inheritance Tree | |
* ------------------------ | |
* | |
* INPUT | |
* | |
* Readable → ReadableExactly | |
* ↓ ↓ |
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
#ifndef TEST_IREF_HPP | |
#define TEST_IREF_HPP | |
#include <concepts> | |
#include <cstdint> | |
#include <iterator> | |
#include <memory> | |
#include <utility> | |
template <std::input_or_output_iterator It> |
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
#include <iostream> | |
#include <memory> | |
#include <string> | |
template <typename T> | |
using allocator = std::allocator<T>; | |
template <typename A> | |
concept HasAllocatorTraits = requires | |
{ |
NewerOlder