Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

nunoc

nunoc nunoc

Niner since 2006

  • Concurrency and Coordination Runtime

    Great! Those features really do simplify the implementation of our app. Smiley
    What I meant in the the first question was if the Ports are threadsafe: for instance, can I post to them from different CCR Tasks, eventually running simultaneously, without having to worry about race conditions in the Port's object, right?

  • Concurrency and Coordination Runtime

    Hi again!

    Can the Ports, Queues and Dispatchers be used as "globals" (class variables, for instance) from within the tasks?

    Is it possible to extend a Port with a different strategy (like a LIFO or a priority queue instead of a FIFO)?

    How are the objects passed by the ports to the tasks? By reference or copied?

    Thanks!

  • Concurrency and Coordination Runtime

    Thanks! And I'm also looking forward to see the distribution features you mentioned!
  • Concurrency and Coordination Runtime

    Hi! I have been playing with the CCR and I think it takes away some of the pain of working with concurrency, which is very good!
    However I'm a little confused of how should one program with the CCR Perplexed

    For instance, is it correct to send ports to ITasks and post from within them (like in the following example)?

      static void HandlerPorts(Port<int> pInts)
      {
       pInts.Post(42);
      }

      static void Main(string[] args)
      {
       using (Dispatcher dispatcher = new Dispatcher(0, "CcrDispatcher"))
       {
        DispatcherQueue queue = dispatcher.AddQueue("MainQueue");
        Port<int> pInts = new Port<int>();
        Port<Port<int>> pPorts = new Port<Port<int>>();

        Arbiter.Activate(queue, Arbiter.Receive<int>(true, pInts,
         delegate(int value){
          Console.Out.WriteLine(value);
         }
         ));

        for(int i=0; i<2; i++){
         Arbiter.Activate(queue, Arbiter.Receive<Port<int>>(false, pPorts, HandlerPorts));
         pPorts.Post(pInts);
        }
        System.Threading.Thread.Sleep(1000);
       }
      }

    This seems to work as I want, printing twice the value 42. But am I messing with the CLR in any way I shouldn't?

    Also, is the API defined anywhere? I've heard that there are some quite neat ways of using the CLR (operator overloading, like the | for choice).

    Thanks and keep up the good work! Smiley
    Nuno