MultiThreaded gamma

Hi, I am trying to find any example or forum, girlpower or any advice how to work with multiple threads in gamma.

I have implemented this simulation that is running on hex gird - http://patarnott.com/pdf/SnowCrystalGrowth.pdf

In my naive imagination, I would slice this hex grid into 20 parts, do the calculations on every part with different thread from the grid that is in memory, and then connect them all together, to be ready for another pass.

Is this possible? Can I find some resource on how to do this with gamma?

I don’t think it’s a good idea to spawn 20 threads, i guess it would take more time to build an infrastructure to maintain them… I guess you should look on to Async Region… Since you can do ForEach and then Async… Anyways idea behind async, that it builds result and returns that result to main thread… In other words, you do calculation, you get result of it, then you call do new calculation, all you keep is the result and calculation itself get’s destroyed by GC… So it’s kind spawn job > finished, destroy job keep result > spawn new job and so on…

Have a look at this:

@antokhio I want to do this as exercise so i can have it in toolset, not really about efficiency. I also thought if there ever was a task to try it on, this one seems valid. I know it would probably work in shader, that might be next step after this.

@bjoern yeah I checked it but the thread fizzeled into nothing and I was not sure if it is still all valid since things change very often with vl/gamma. I will look through patches from there a bit more

Hey Stix, just for you to see my point here, I’m not aware of threading “c# way” works in vl, so you have only a task and async stuff, I think you have to optimise your problem definition to make tool help you…

Generally speaking I think the treading was abandoned in oop to task/async since it’s easier to control, with threads you can only pass messages between threads and implement whole state logic on each…

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.