Skip to content

Instantly share code, notes, and snippets.

View frroossst's full-sized avatar
👨‍💻
SyntaxError

Adhyan H. Patel frroossst

👨‍💻
SyntaxError
View GitHub Profile
@frroossst
frroossst / hilligans_list.rs
Created September 15, 2025 04:18
Rust Impl of Hilligan's C concurrent queue list
use std::sync::atomic::{AtomicU32, AtomicU64, AtomicUsize, Ordering};
use std::mem::MaybeUninit;
use std::cell::UnsafeCell;
#[derive(Debug, PartialEq)]
pub enum QueueResult {
Success = 0,
Failure = 1,
}
/*
* Under high contention loads a futex should perform worse.
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <linux/futex.h>
#include <sys/syscall.h>
@frroossst
frroossst / sync-primitives.c
Last active December 20, 2024 04:01
Implementing Monitors, IPC, Semaphore, using each other (CMPT 332)
/*
* GLWT(Good Luck With That) Public License
* Copyright (c) Everyone, except Author
*
* Everyone is permitted to copy, distribute, modify, merge, sell, publish,
* sublicense or whatever they want with this software but at their OWN RISK.
*
* Preamble
*
* The author has absolutely no clue what the code in this project does.