Chunks and Tasks sample code -- Fibonacci

This example program computes a Fibonacci number using a recursive procedure.

The program uses only one chunk type, "CInt", representing an integer number. Two task types are used: "Fibonacci" and "Add", where Fibonacci is the task type for computing a Fibonacci number. The implementation of the Fibonacci task type creates new Fibonacci tasks recursively, and uses the Add task type to add up the results. Both task types use the CInt chunk type for both input and output chunks.

This example is essentially the same as the example code listed in the appendix in the original Chunks and Tasks article.

Download the source code for the Fibonacci sample program using this link:

sample-fibonacci.tar.gz

To compile and run the program, a Chunks and Tasks library implementation is needed. See the Library implementations page for descriptions of how to compile and run the program using the library implementations available there.