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
#!/usr/bin/python | |
import sys | |
import subprocess | |
import re | |
import time | |
from termcolor import colored | |
import math | |
import pygments | |
from pygments.lexers import CppLexer, PythonLexer |
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 os | |
import errno | |
import fcntl | |
def open_file_write_exclusive(file_name): | |
""" | |
If file is available - returns file object. | |
If file is locked - returns None. | |
If error occured - throws error. | |
Truncates opened file. |
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 TRANSFER_RING_BUFFER_H | |
#define TRANSFER_RING_BUFFER_H | |
class TransferRingBuffer | |
{ | |
public: | |
TransferRingBuffer() = default; | |
TransferRingBuffer(int size): bufSize(size) | |
{ |
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 SIMPLE_SPINLOCK_H | |
#define SIMPLE_SPINLOCK_H | |
#include <atomic> | |
class Spinlock | |
{ | |
public: | |
Spinlock() | |
{ |
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
#!/usr/bin/python | |
import sys | |
import subprocess | |
import re | |
import time | |
from termcolor import colored | |
import keyword | |
import math |