# \`similar\` does not produce a SharedArray when fed one

**URL:** <https://discourse.julialang.org/t/similar-does-not-produce-a-sharedarray-when-fed-one/23287>\
**Category:** Internals & Design\
**Tags:** parallel\
**Created:** [April 18, 2019, 11:45pm UTC](https://discourse.julialang.org/t/similar-does-not-produce-a-sharedarray-when-fed-one/23287 "2019-04-18T23:45:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amrods](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amrods/32/2543_2.png) [@amrods](https://discourse.julialang.org/u/amrods)\
**Post date:** [April 18, 2019, 11:45pm UTC](https://discourse.julialang.org/t/similar-does-not-produce-a-sharedarray-when-fed-one/23287/1 "2019-04-18T23:45:46Z")

</div>

Consider this:

```julia
using SharedArrays
x = SharedArray{Float64}(1, 1)
y = similar(x)

```

I would expect `y` to also be a `SharedArray`, however

```julia
julia> typeof(x)
SharedArray{Float64,2}

julia> typeof(y)
Array{Float64,2}

```

---

<div class="post-metadata">

**Author:** ![eliassno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eliassno/32/18917_2.png) [@eliassno](https://discourse.julialang.org/u/eliassno)\
**Post date:** [April 19, 2019, 1:42am UTC](https://discourse.julialang.org/t/similar-does-not-produce-a-sharedarray-when-fed-one/23287/2 "2019-04-19T01:42:36Z")

</div>

The source array is actually an `Array`

> <https://github.com/JuliaLang/julia/blob/80516ca20297a67b996caa08c38786332379b6a5/stdlib/SharedArrays/src/SharedArrays.jl#L555>

You can also check out

> [@Why does \`similar(::SharedArray)\` create an \`Array\`?](https://discourse.julialang.org/t/why-does-similar-sharedarray-create-an-array/6673/2):
>
> Some discussion: [https://github.com/JuliaLang/julia/pull/12964](https://github.com/JuliaLang/julia/pull/12964), see also [https://github.com/JuliaLang/julia/pull/23747](https://github.com/JuliaLang/julia/pull/23747)
