Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Languages Misc > Re: RFC: C and ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 16 of 20 Topic 1080 of 1217
Post > Topic >>

Re: RFC: C and concurrency (as CC extensions)

by "cr88192" <cr88192@[EMAIL PROTECTED] > Dec 13, 2007 at 10:25 PM

"John Whorfin" <_@[EMAIL PROTECTED]
> wrote in message 
news:47611be8$0$9878$afc38c87@[EMAIL PROTECTED]
>> well, one idea I encountered recently was CSP, which implementing as a 
>> library feature was simple enough that I did this during part of one of

>> my morning cl***** (diverting a little of my attention from the 
>> lecture...).
>
> You may want to investigate occam and the entire slew of languages that 
> targetted the transputer.  occam embodied much of CSP and the transputer

> was an occam "engine". CSP/occam's alternates (ALT) is one thing that is

> not nicely done, IMHO, without direct syntax sup****t.  Defining
structures 
> or arrays to hold channels, and optional guards, at run-time is messy, 
> occam's ALT is far easier to use.  occam also has TIMERs and the AFTER 
> construct making timed ALT constructs simple to express and "replicated 
> ALT" for handling multiple input channels.   Don't get me wrong. I'm 
> addicted to C expression syntax and have been using it for well over 20 
> years but the occam CSP-inspired concurrency features were quite nice.
>

I don't know. I implemented the whole thing as function calls.

dyt chn;

chn=chnNew();

chnPutInt(chn, 3);

i=chnGetInt(chn)+chnGetInt(chn);
....

all the passing machinery is done internal to these functions.

for syntax I had considered overloading '<<' binary, adding '<<' as a
unary, 
and adding a built-in 'chan' type (would be a combining type, much as 
'complex').

for the most part, all this should be fairly minor (just, I don't want to 
add any new syntax right at this point, for other reasons...)..

chn<<3;
i=<<chn + <<chn;

albeit, I would like something other than '<<', not much better options 
exist right now ('<-' can't be added apart from violating the C standard).

'<<' as a prefix operator looks terribly ugly IMO.
'~', though validly a unary operator (thus avoiding needing to add new 
operator handling), and not cla****ng with anything useful, may not give
the 
intended effect.

i=~chn + ~chn;

or such...


> Transputer C compilers invariably had extensions to take advantage of
the 
> processor's features (channel I/O is directly implemented by the 
> processor).  One, who's name escapes me, permitted channels as lvalues
and 
> rvalues allowing expressions such as "out = in1 + in2" to perform
implicit 
> channel I/O.   I think the explicit get/put operations are safer overall

> from a program comprehension PoV but the implicit form is kind of neat.


I had considered making it explicit.
explicit handling allows first-class handling of channels as values.
 




 20 Posts in Topic:
RFC: C and concurrency (as CC extensions)
"cr88192" <c  2007-12-09 16:46:12 
Re: RFC: C and concurrency (as CC extensions)
Robbert Haarman <comp.  2007-12-09 09:18:45 
Re: RFC: C and concurrency (as CC extensions)
"cr88192" <c  2007-12-09 20:29:19 
Re: RFC: C and concurrency (as CC extensions)
George Peter Staplin <  2007-12-09 10:09:33 
Re: RFC: C and concurrency (as CC extensions)
"cr88192" <c  2007-12-09 21:05:07 
Re: RFC: C and concurrency (as CC extensions)
"Douglas A. Gwyn&quo  2007-12-10 16:34:37 
Re: RFC: C and concurrency (as CC extensions)
"cr88192" <c  2007-12-11 18:32:08 
Re: RFC: C and concurrency (as CC extensions)
"cr88192" <c  2007-12-12 10:37:02 
Re: RFC: C and concurrency (as CC extensions)
"Douglas A. Gwyn&quo  2007-12-12 18:19:29 
Re: RFC: C and concurrency (as CC extensions)
"cr88192" <c  2007-12-15 07:48:35 
Re: RFC: C and concurrency (as CC extensions)
Roberto Waltman <usene  2007-12-12 15:00:49 
Re: RFC: C and concurrency (as CC extensions)
"cr88192" <c  2007-12-13 06:34:23 
Re: RFC: C and concurrency (as CC extensions)
Roberto Waltman <usene  2007-12-12 15:56:02 
Re: RFC: C and concurrency (as CC extensions)
"cr88192" <c  2007-12-13 17:09:04 
Re: RFC: C and concurrency (as CC extensions)
John Whorfin <_@[EMAIL  2007-12-13 22:47:44 
Re: RFC: C and concurrency (as CC extensions)
"cr88192" <c  2007-12-13 22:25:19 
Re: RFC: C and concurrency (as CC extensions)
ram@[EMAIL PROTECTED] (S  2007-12-18 18:59:03 
Re: RFC: C and concurrency (as CC extensions)
"cr88192" <c  2007-12-19 07:54:44 
Re: RFC: C and concurrency (as CC extensions)
Robbert Haarman <comp.  2007-12-19 06:04:59 
Re: RFC: C and concurrency (as CC extensions)
"cr88192" <c  2007-12-20 06:02:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 18:06:42 CDT 2008.