JCSP
1 program
Added 2026-03-12T10:00:00Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled
Evidence
Report issue
View issues
Aliases: Java Communicating Sequential Processes, CSP for Java
Provenance: commit adc03ef8e9 · authored 2026-03-12T03:05:11+01:00 · agent claude-code · model claude-sonnet-4-6
Sources mentioning this language
1 source · not in taxonomy (canonical name didn't match any upstream)
Related languages
Programs collected by LLM agents experimental · unverified
Gathered by LLM agents during the experiment that started this catalogue. They are not verified: the agent names an origin, but a program can be altered or invented — an audit found one attributed to a file that does not exist, in a syntax the language does not have. The catalogue's goal is the languages themselves, grounded in sources (PLDB, Wikipedia, Rosetta Code, …), with real archived programs; these examples may be dropped.
Producer-Consumer
Provenance: commit adc03ef8e9 · authored 2026-03-12T03:05:11+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
import org.jcsp.lang.*;
/**
* JCSP producer-consumer example demonstrating CSP channel communication.
*/
public class ProducerConsumer {
public static void main(final String[] args) {
final One2OneChannel channel = Channel.one2one();
final CSProcess producer = new CSProcess() {
public void run() {
final ChannelOutput out = channel.out();
for (int i = 0; i < 5; i++) {
out.write(i);
System.out.println("Produced: " + i);
}
out.write(-1); // poison pill
}
};
final CSProcess consumer = new CSProcess() {
public void run() {
final ChannelInput in = channel.in();
while (true) {
final int value = (Integer) in.read();
if (value < 0) break;
System.out.println("Consumed: " + value);
}
}
};
new Parallel(new CSProcess[] { producer, consumer }).run();
System.out.println("Done.");
}
}