Within the next few days, support for native threads will be merged into to
the development version of Julia
(https://github.com/JuliaLang/julia/pull/13410).
You can also used the SharedArray type which Julia already has, which lets
multiple Julia processes running on the same machine share memory. You
would use the standard Julia task-parallel tools (like @parfor, etc.) in
that model.
On Wednesday, October 7, 2015 at 8:34:02 AM UTC-4, cheng wang wrote:
>
> Thanks all for replying.
>
> I have read th parallel computing document before I post this.
> Actually, what I mean is a shared memory model not a distributed model.
>
> My daily research involves extensively using of blas and parallel for-loop.
> Julia has a perfect support for blas, as well parallel for-loop could be
> solved by multi-process.
>
> However, if I want to have a shared array that could do efficient blast
> and parallel for-loop in the same time,
> what is the best solution ??
>
>
> On Tuesday, October 6, 2015 at 4:24:51 PM UTC+2, Andrei Zh wrote:
>>
>> Julia supports multiprocessing pretty well, including map-reduce-like
>> jobs. E.g. in the next example I add 3 processes to a "workgroup",
>> distribute simulation between them and then reduce results via (+) operator:
>>
>>
>> julia> addprocs(3)
>> 3-element Array{Int64,1}:
>> 2
>> 3
>> 4
>>
>>
>> julia> nheads = @parallel (+) for i=1:200000000
>> Int(rand(Bool))
>> end
>> 100008845
>>
>> You can find full example and a lot of other fun in official
>> documentation on parallel computing:
>>
>> http://julia.readthedocs.org/en/latest/manual/parallel-computing/
>>
>> Note, though, that it's not real (i.e. Hadoop/Spark-like) map-reduce,
>> since original idea of MR concerns distributed systems and data-local
>> computations, while here we do everything on the same machine. If you are
>> looking for big data solution, search this forum for some (dead or alive)
>> projects for it.
>>
>>
>>
>> On Monday, October 5, 2015 at 11:52:21 PM UTC+3, cheng wang wrote:
>>>
>>> Hello everyone,
>>>
>>> I am a Julia newbie. I am thrilled by Julia recently. It's an amazing
>>> language!
>>>
>>> I notice that julia currently does not have good support for
>>> multi-threading programming.
>>> So I am thinking that a spark-like mapreduce parallel model +
>>> multi-process maybe enough.
>>> It is easy to be thread-safe and It could solve most vector-based
>>> computation.
>>>
>>> This idea might be too naive. However, I am happy to see your opinions.
>>>
>>> Thanks in advance,
>>> Cheng
>>>
>>