Title: 'NET
1????????-??????????????? ?????? ? ?????????????
???????????????? ?? ????????? .NET
- Polyphonic C ?????????? ????? C ? ?????
??????????? ???????????? ??????? ???????????????? - MC ?????????????? ??????? Polyphonic C
- ??????? ???????? ?? ????? MC
- ??????????
- ?????????? ? ????????
2Polyphonic C ?????????? ????? C ? ??????
???????????? ????????????? ?????????????
- Nick Benton, Luca Cardelli, Cedric Fournet
(Microsoft Research Laboratory, Cambridge) - "Modern Concurrency Abstractions for C" - to
appear in ACM Transactions on Programming
Languages and Systems - http//research.microsoft.com/nick/polyphony
3?? ???????
- p - ?????????? ( R. Milner, 1992 )
- Join-?????????? (C. Fournet, G.Gonthier, 1996)
- Polyphonic C ( N.Benton, L.Cardelli, C.Fournet,
2002 ) - Polyphonic C C
- ??????????? ?????? ??????
C
4??????????? ?????? Polyphonic C
- ??????????? ??????
- async Compute( int n )
- // method body
-
- ??????
- int Get() async c( int x )
- return ( x )
-
5MC ?????????????? ??????? ????? Polyphonic C
- Movable-??????
- movable Compute( int n )
- // method body
-
- ??????
- int Get() Channel c( int x )
- return ( x )
-
6MC ?????????????? ??????? ????? Polyphonic C
- ????? ???????????? ??? movable-???????
- functional
- non-functional
- global
- ?????????????? ??????
- movable Compute( int n,
- Channel( int ) c )
- movable Compute( int n,
- Channel( Channel( int ) ) c )
7??????? ???????????????? ?? MCn-?? ?????
?????????
- class Fib
- public movable Compute( int n, Channel( int ) c
) - if ( n lt 2 ) c( 1 )
- else
- Fib f new Fib()
- Compute( n - 1, f.c1 )
- Compute( n - 2, f.c2 )
- c( f.Get2() )
-
-
- int Get2() Channel c1( int x )
- Channel c2( int y )
- return x y
-
-
8??????? ???????????????? ?? MCn-?? ?????
?????????
- class ComputeFib
- public static void Main( string args )
- int n System.Convert.ToInt32( args 0 )
- ComputeFib cf new ComputeFib()
- Fib fib new Fib()
- fib.Compute( n, cf.c )
- Console.WriteLine( n "-th Fibonacci number
is - cf.Get() )
-
- public int Get() Channel c( int x )
- return ( x )
-
-
9??????? ???????????????? ?? MC?????? ??????????
- ??????????????? ??????
- public class BDChannel
- public BDChannel()
- public void Send( params object o )
- public object Receive()
-
10??????? ???????????????? ?? MC?????? ??????????
- movable Sieve( BDChannel cin, BDChannel cout )
- int head (int) cin.Receive()
- if ( head -1 )
- cout.Send( -1 )
- else
- cout.Send( head )
- BDChannel inter new BDChannel()
- Sieve( inter, cout )
- filter( head, cin, inter )
-
11??????????
- ?????????? MC ??????????
Runtime-??????? - ??????????
- ??????????? ????????? ?? MC ? C
- ?????????????? ?? ??? ?????????? ?
????????? Runtime-??????? - Runtime
- ???????? ????????????? ???????? (ResourceManager)
- - ???????????? ?????? movable-??????? ?????
?????? - ??????? ???? (WorkNode)
- - ????????? ? ???????????? ??????????
movable-??????? - ???????????? (Communicator)
- - ?????????? ????????? ????????? ????????,
??????????? ?? ?????-???? ????
12??????????????? ????????? (??????? 40)
???????????? ???? ????? Pentium III 600 MHz x
2, 512 Mb
13??????????????????? ????????????
???????????? ???? ????? Pentium III 600 MHz x
2, 512 Mb
14?????????????? ?????
???????????? ???? ????? Pentium III 600 MHz x
2, 512 Mb
3(?????????) 100(??????) 100(??????) 33(??????)
15?????? ??????????
16?????? ??????????
17????????
- ?????????? ??????? ? Windows
- ?????????????????? C-???????? ?????? C ?
Fortran-???????? - ???????? ????????????
- ????????? C
- ???????????? ?????????? ???????