Newsgroups: comp.sys.transputer
From: mse@wolverine.utias.utoronto.ca (Manfred Sever)
Subject: Mixing OCCAM and C?
Organization: University of Toronto Institute for Aerospace Studies
Date: 22 Sep 94 20:48:50 GMT
Message-ID: <1994Sep22.164850.18383@jarvis.cs.toronto.edu>

Greetings oh humble transputer users,

i have a question with regard to mixing OCCAM2 and ANSI C
code at the configuration level.

I have some OCCAM code that contains the code fragments:

...
PROTOCOL Message IS BYTE ; BYTE :
...
...
CHAN OF Message In :

...

  BYTE x , y :

  SEQ
    In ? x ; y
...


and I have another C code fragment:

...
Channel *In = (Channel *)get_param(3);

...

ChanOut ( Out , i , 2 * sizeof(unsigned char) );

...


All of this stuff is running on one T800 for the moment.
However the communication between the `C' ChanOut and
the `OCCAM' In ?   is never completed; it deadlocks.

Why?

If I change the Message PROTOCOL so that:

PROTOCOL Message IS BYTE :

and make the appropriate modifications to both the C and OCCAM
routines, no deadlock occurs and the code runs to completion.

Is there something wrong with the ChanOut?  Can I not use
OCCAM PROTOCOLs with C?

Any help would be greatly appreciated.

Manfred.

-- 
===============================================================================
Manfred D. M. Sever               |
                                  |
Space Robotics Group,             | E-mail: sever@ecf.utoronto.ca

