Skip to content

Instantly share code, notes, and snippets.

View vincentdephily's full-sized avatar

Vincent de Phily vincentdephily

  • Ireland & France
View GitHub Profile
#!/usr/bin/env run-cargo-script
//! This example explores the implications of using a channel vs a mutex to send data from many threads into a single object.
//!
//! ```cargo
//! [dependencies]
//! arraydeque = "0.4.2"
//! clap = "2.31.2"
//! threadgroup = "0.1.0"
//! ```
// UPSTREAMING: Though it has seen some refactoring, this code has grown organically and doesn't use
// the latest and greatest assert_cmd APIs (actually it only uses assrt_fs). This file has been
// carelessly stripped from an internal project, don't expect it to compile as-is.
use assert_fs::{prelude::*, TempDir};
use libc::{c_int, kill, SIGCONT, SIGINT, SIGKILL, SIGTERM};
use log::*;
use regex::Regex;
use std::{collections::{HashMap, HashSet},
env,