Skip to content

Instantly share code, notes, and snippets.

View vjabrayilov's full-sized avatar
🎯
Focusing

Vahab Jabrayilov vjabrayilov

🎯
Focusing
View GitHub Profile
public static void main(String[] args) throws InterruptedException {
if(args.length != 1)
System.exit(-1);
var type = args[0];
var lock = new ReentrantLock();
var numThreads = 100;
var numOperations = 1000000;
Thread[] threads = new Thread[100];
final long[] counter = {0};
Runnable runnable = ()->{
@vjabrayilov
vjabrayilov / MultiPaxos.java
Created June 9, 2022 14:27
MultiPaxos with grpc service as subclass ...
package paxos;
import io.grpc.stub.StreamObserver;
import java.time.Instant;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.ReentrantLock;
import log.Log;
import multipaxosrpc.HeartbeatRequest;
import multipaxosrpc.HeartbeatResponse;
import multipaxosrpc.MultiPaxosRPCGrpc;
EXTENDS Naturals, Sequences
CONSTANTS Producers,
Consumers,
BufCapacity,
Data
ASSUME /\ Producers # {}
/\ Consumers # {}
/\ Producers \intersect Consumers = {}
\documentclass{book}
\usepackage{blindtext}
\usepackage{titlesec}
\usepackage{linegoal}
\titleformat{\chapter}[block]
{\normalfont\bfseries}
{%\LARGE\thechapter}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.