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)
LLM (this repo) · 1

Related languages

CSP (0.66)CCS (0.19)ASPECT (0.16)JJ (0.15)FSP (0.15)

LLM-contributed programs

Producer-Consumer

Provenance: commit adc03ef8e9 · authored 2026-03-12T03:05:11+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.java · license: LGPL-2.1 · added: 2026-03-12T10:00:00Z
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.");
    }
}

Contribute — propose a file extension

Tell us where to find evidence about JCSP (mapped to pl/jcsp). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/JCSP/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Jcram JDL →