среда, 2 октября 2013 г.

DataFlow native concurrency has been implemented in SynapseGrid

As already have been discussed there are a few possible ways to run the StaticSystem (synaptic grid) on a multicore processor. The one that was implemented was running subsystems inside Akka actors.

However, this is not the finest grained concurrency possible. The whole subsystem will run inside a single thread (the current actor's thread) and it can become a bottle neck for other subsystems.

What is the least element that can run in parallel? For SynapseGrid it is a function that connects two contacts. If it is pure function then it can safely run in a separate thread.

Special care should be taken when dealing with states. The access to states should be serialized according to the principle "happen-before". We cannot read the state value before all computations that could influence it have completed. And no other computation that requires this state can start until we complete this computation. However, all the other computations can run in parallel. In particular if two computations use different states then they can run in parallel.

Recently this fine-grained approach has been implemented in SynapseGrid (synapse-grid-concurrent module). To run a system in some ExecutionContext one converts it to a parallel SimpleSignalProcessor:

   import scala.concurrent.ExecutionContext. Implicits.global
   val f = system.toStaticSystem. toParallelSimpleSignalProcessor. toMapTransducer(input, output)
   val y = f(x)

That's it. Now the whole system runs with fine-grained parallelism. To compare that the results are absolutely the same, the same system can also be converted to a traditional single-threaded version:

   val g = system.toStaticSystem. toSimpleSignalProcessor. toMapTransducer(input, output)
   val y2 = g(x)
   assert(y === y2)

The concurrency implementation guarantees that the results will be the same.

The tests for the module contains examples of how it works.

The dependency for the synapse-grid-concurrent module:

"ru.primetalk" % "synapse-grid-concurrent" % "1.3.0"

The source code is published on GitHub.

Ярлыки: , , , , ,

Комментарии: 4:

В 3 марта 2022 г. в 09:32 , Blogger varlandquery сказал(а)...

Betway Casino Resort in Biloxi, MS - JT Hub
JT Hub 아산 출장마사지 Casino Resort in Biloxi, MS. Discover the 천안 출장마사지 best sportsbook, casino, and restaurants 양산 출장안마 in Biloxi, MS. 사천 출장마사지 JT Hub 통영 출장마사지 is the premier gaming

 
В 5 марта 2022 г. в 03:31 , Blogger balbirbacher сказал(а)...

Mens Black Titanium Wedding Band - titanium-arts.com
A mens smith titanium black titanium titanium wedding band wedding band, is a titanium ingot traditional wedding band that will be woven on the back and also be titanium solvent trap held by a male titanium exhaust tubing or female band member. A wedding band

 
В 29 ноября 2022 г. в 23:42 , Anonymous Анонимный сказал(а)...

This is an easy card sport with little blackjack expertise required to play. It’s straightforward to start out|to begin} with easy gambling video games at TwinSpires Casino. Play for free to see just how straightforward on line casino video games could be for novices. When you make your first deposit, be sure to|make sure to|remember to} declare your new participant bonus. Welcome bonuses are a common follow and customarily encompass a sum of cash that you simply get when becoming a member of an online on line casino. These welcome bonuses are typically free from any deposit requirement, that means that you wouldn't have to place 바카라사이트 down any cash to start out|to begin} enjoying in}.

 
В 8 декабря 2022 г. в 13:24 , Anonymous Анонимный сказал(а)...

The optimal holding technique is to take the motion that results in the very best expected return. It's an essential exercise to enumerate 카지노사이트.online them all because of|as a end result of}, as we've seen, some of the the} results usually are not intuitively apparent. [newline]This table confirms that the holding technique we determined of holding four playing cards to the Flush, is the optimal play if dealt these playing cards. This is an effective expected return, and only a hair under the expected worth of holding four playing cards to the flush.

 

Отправить комментарий

Подпишитесь на каналы Комментарии к сообщению [Atom]

<< Главная страница