You should be aware however, that there can be problems with accessing
Julia code and variables from multiple threads.  In particular, if you pass
a Julia callback to C code, that Julia callback needs to run on the same
thread as the one that created the callback in the first place, I believe.
 You can read about this at the Thread-Safety
<http://julia.readthedocs.org/en/latest/manual/calling-c-and-fortran-code/#thread-safety>
section
of the page Tim was talking about.
-E


On Sat, Jul 26, 2014 at 11:59 AM, Tim Holy <[email protected]> wrote:

> Yes, check out the section of the manual on calling C and Fortran code.
>
> --Tim
>
> On Saturday, July 26, 2014 08:16:35 AM David A. wrote:
> > Sounds good. Would it be possible for the C++ function to have access to
> > Julia's arrays without copying them? (ie passing them by reference)
> >
> > On Saturday, July 26, 2014 9:21:06 AM UTC-3, Tim Holy wrote:
> > > On Friday, July 25, 2014 09:49:47 PM David A. wrote:
> > > > Is it possible to parallelize the execution of a C++ function using
> > >
> > > Julia?
> > > Yes, if you can call the C++ function in the first place. Currently
> your
> > > best
> > > bet is to write a C wrapper. There's the very primitive Cpp package,
> and
> > > Keno's got a real solution to the problem over at
> > > https://github.com/Keno/CXX.jl, but I don't know if it's really ready
> for
> > > users who are not Keno :).
> > >
> > > > And would it be similarly efficient as doing it directly in C++?
> > >
> > > Depends on how you do it. You can, of course, just call pthreads from
> > > julia
> > > (it's a C library, after all). Alternatively start a number of julia
> > > processes.
> > >
> > > You will want to read the parallel programming section of the manual.
> > >
> > > --Tim
>
>

Reply via email to