Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 580 Bytes

README.md

File metadata and controls

34 lines (26 loc) · 580 Bytes

A Supercollider Quark

A thread synchronisation barrier and a channel.

Barrier will wait until n number of threads have finished.

Channel deals with consumers and produces.

r = Routine.run {
	var b  = Barrier.collect(
		{ var v = 1.0.rand; v.wait; v},
		{ var v = 1.0.rand; v.wait; v},
		{ var v = 1.0.rand; v.wait; v},
		{ var v = 1.0.rand; v.wait; v}
	);
	\waiting.postln;
	b.value.postln;
	\done.postln;
}
~ch = Channel();

fork { loop {
  var t = 1.0.rand;
  t.wait;
  ~ch.push(t);
}};

fork { loop { ~ch.pop().debug(\got) }};