Thread View: comp.sys.transputer
1 messages
1 total messages
Started by Andy Rabagliati
Fri, 19 Apr 1991 14:59
Parallel programming examples - the problem
Author: Andy Rabagliati
Date: Fri, 19 Apr 1991 14:59
Date: Fri, 19 Apr 1991 14:59
54 lines
2326 bytes
2326 bytes
Running a parallel programming course recently, we wrote solutions in C and occam to the problems below. Problems - 1) A simple buffering problem, consisting of a key from the keyboard travelling through a process pipe and back to the screen, and 2) A ring buffer (single buffer with pointers chasing each other) replacement for the process pipe. Note that the second is an efficient functionally identical replacement for the former, which can be adapted for high performance buffering generally. In that case, The in and out indices can point to arrays of large objects, to save copying. An extra synchronisation step will be needed before incrementing the output index. The result will be a program that obeys strict occam usage rules, but will fail the present generation usage checker. If anyone is interested, I will post a solution to that as well. However, our solutions following all pass the occam usage checker. Anyone care to write a checker for the (functionally identical) C solution ? (-: I also believe they are close to minimal solutions. They make an interesting comparison between the languages. The programs are short, (one pagers) and cover PAR and ALT. There is no attempt to cover Protocols, functions, or even multiply and divide. For those parallel programming hackers, check out our solution to guarded ALTs in C !!! Software - It uses the Inmos D7205 occam compiler, our D7214 C compiler, and the 'Jeff Mock' concurrency library, used by others including Logical Systems, OR. Both these compilers come with the library. Boards - any B004/B008 compatible board, i.e. most of them, including the CSA educational kit. It is probably just a makefile change to port it to a Sun, and any of a number of boards. Solutions follow in a SHAR file. Cheers, Andy Rabagliati EMAIL:- andyr@inmos.COM
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads