brk_multithreaded.rs 291 B

12345678910111213141516171819
  1. extern crate ralloc;
  2. use ralloc::sys::inc_brk;
  3. use std::thread;
  4. fn main() {
  5. let mut threads = Vec::new();
  6. for _ in 0..1000 {
  7. threads.push(thread::spawn(|| {
  8. inc_brk(9999).unwrap();
  9. }));
  10. }
  11. for i in threads {
  12. i.join().unwrap();
  13. }
  14. }