Tim, Thanks for the response. 

How can I determine whether my structure (a composite type) is a contiguous 
block of memory? The composite type has a few fields. One of the fields has 
type Array{Array{Uint16,1},1} and another has type 
Array{Array{Float64,2},1}. Am I out of luck?

What does it mean to reinterpret a composite type as a 
SharedArray{Uint8,1}? Is that something like casting?




On Tuesday, May 6, 2014 7:32:47 PM UTC-7, Tim Holy wrote:
>
> If your structure is a contiguous block of memory, you could presumably 
> use a 
> SharedArray{Uint8,1} and then reinterpret it as your custom object. But if 
> you 
> want independently garbage-collectable constituents, this is not likely to 
> be 
> feasible. 
>
> --Tim 
>
> On Tuesday, May 06, 2014 03:03:01 PM Bob Quazar wrote: 
> > In Julia, is it possible to share read-only data structures between 
> > threads/processes running on different processors, without making a copy 
> of 
> > the entire data structure for each thread? The data structure I need to 
> > share isn't of "bit type", so I can't use a SharedArray. And each worker 
> > needs to read random parts from the full data structure, so I can't use 
> a 
> > distributed array. I also tried just putting "@parallel" before a for 
> loop, 
> > whose body accesses the data structure I want to share, but I believe 
> the 
> > whole data structure gets copied at each iteration. (I could be wrong 
> about 
> > that, but it's certainly very slow.) Does Julia have some alternative to 
> a 
> > copy-on-write for sharing data between threads? 
> > 
> > Thanks in advance! 
> > 
> > --Bob 
>

Reply via email to