Skip to content

Supercollider Quark. A synchronisation barrier and a channel.

Notifications You must be signed in to change notification settings

JordanHendersonMusic/BarrierAndChannel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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) }};

About

Supercollider Quark. A synchronisation barrier and a channel.

Topics

Resources

Stars

Watchers

Forks