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<stdlib.h> | |
#include<stdio.h> | |
#include<pthread.h> | |
pthread_mutex_t *forks; | |
pthread_t * philosophers; | |
pthread_mutex_t output_lock; | |
int nb_philosopher = 5; | |
int take(int philosopher, int fork) { |
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
let identity = fun x -> x | |
let tuple = fun t1 -> fun t2 -> fun x -> x t1 t2 | |
let proj12 = fun t -> t (fun x1 -> fun x2 -> x1) | |
let proj22 = fun t -> t (fun x1 -> fun x2 -> x2) | |
let shift0 = fun n -> fun z -> fun x0 -> fun x1 -> x0 (n z x0 x1) | |
let shift1 = fun n -> fun z -> fun x0 -> fun x1 -> x1 (n z x0 x1) |