Skip to content

Instantly share code, notes, and snippets.

View klopp's full-sized avatar

Vsevolod Lutovinov klopp

  • Russia
  • 12:35 (UTC +03:00)
View GitHub Profile
@klopp
klopp / pool.c
Created July 3, 2023 13:42 — forked from bodokaiser/pool.c
Simplistic thread pool implementation with pthread and libuv QUEUE
#include "queue.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#define THREADS 3
/**
* Task queue.
@klopp
klopp / mock_open.pl
Created April 11, 2019 14:14 — forked from ernix/mock_open.pl
Mock(override) built-in `open` function in perl.
#
# http://perldoc.perl.org/CORE.html#OVERRIDING-CORE-FUNCTIONS
# > To override a built-in globally (that is, in all namespaces), you need to
# > import your function into the CORE::GLOBAL pseudo-namespace at compile
# > time:
# >
# > BEGIN {
# > *CORE::GLOBAL::hex = sub {
# > # ... your code here
# > };