##// END OF EJS Templates
refactoring
refactoring

File last commit:

r156:97fbbf816844 v2
r177:a0ff6a0e9c44 ref20160224
Show More
Program.cs
37 lines | 922 B | text/x-csharp | CSharpLexer
cin
improved tracing...
r93 using System;
using Implab;
cin
Added support for 'await' operator to promises
r151 using System.Threading.Tasks;
cin
improved tracing...
r93
namespace MonoPlay {
class MainClass {
cin
RC: cancellation support for promises + tests
r145
cin
improved tracing...
r93 public static void Main(string[] args) {
cin
minor fixes
r94 if (args == null)
throw new ArgumentNullException("args");
cin
sync
r103 var t1 = Environment.TickCount;
cin
improved tracing...
r93
cin
Added support for 'await' operator to promises
r151 DoWork().GetAwaiter().GetResult();
cin
JSONWriter improvements
r150
cin
sync
r103 var t2 = Environment.TickCount;
cin
improved performance of promises
r125 Console.WriteLine("done: {0} ms, {1:.00} Mb, {2} GC", t2 - t1, GC.GetTotalMemory(false) / (1024*1024), GC.CollectionCount(0) );
cin
improved tracing...
r93
}
cin
shared locks + tests
r136
cin
Added support for 'await' operator to promises
r151 static IPromise<int> DoItem(int x) {
cin
Promises: SignalXXX methods merged into SignalHandler method....
r156 //return Promise<int>.FromResult(x + 1);
var p = new Promise<int>();
p.Resolve(x+1);
return p;
cin
Added support for 'await' operator to promises
r151 }
cin
JSONWriter improvements
r150
cin
Added support for 'await' operator to promises
r151 static async Task<int> DoWork() {
var c = 0;
for (int i = 0; i < 10000000; i++)
c = await DoItem(c);
return c;
cin
RC: cancellation support for promises + tests
r145 }
cin
shared locks + tests
r136
cin
improved tracing...
r93 }
}