1 Reply Latest reply: Jul 21, 2012 6:14 AM by Alain Mazy RSS

    Real MultiThreading by Concurrency Workers Tutorial

    Alain Mazy Community Member

      Here, found a tutoriel for using Worker(s)

      (in french)

       

      http://www.covergraph.com/blog/

       

       

        • 1. Re: Real MultiThreading by Concurrency Workers Tutorial
          Alain Mazy Community Member

          Hi, i tested shared byteArray in worker but with use High Premium feature (with fastMem Azoth) it's don't work! .. I dont no why, but probably beacause memory mecanism in shareable is incompatible..

           

          Other, if créeate worker in main code (not a external SWF) the function "bpm" is not invoqued! when if is in private or public declaration.. :S it's logic ! it's too dinamic.

           

           

          private function workerMessageHandler(e:Event):void
           {
                         this[inChannel.receive()]; // receiveData contain: "getBpm"
           }
          
          public function getBpm():void
          {
                         var bpm:int = BPM.get(sharedMem);
                         outChannel.send(String(bpm));  
          }
          
          

           

          The worker is not verry simple ..

           

          should be an instruction to tell the player that foncion or property must be in worker. Like:

           

          public worker function (..) {...}

           

          Actual system necessary call each method in a switch case based on receive() value in workerInputHandler. or making a swf for worker..