As show in the example, when JSetM is used there 
no copying of arrays from the client side, so the
server (C code) can use it directly form J (client) memory.
Note: the both sides are J so either side can
be replaced with C.

http://www.jsoftware.com/pipermail/programming/2006-November/004233.html

Also memory mapped files can be considered,
which should reduce physical memory requirements.

Calling invididual C functions has other advantages,
such as uniform profiling of calls on the J side
to compare C and J costs.


--- Devon McCormick <[EMAIL PROTECTED]> wrote:

> Oleg -
> 
> I didn't do the C/J work - I wrote a full, stand-alone C program to
> duplicate what
> my J code was doing.  Originally I thought I would call C to handle only the
> CPU-intensive
> part of what I was doing but I realized that loading the large array into
> memory
> takes a lot of time.  Unless there's some way to make a DLL stay resident in
> memory (with the large array), it didn't make sense to call C to do the one
> step,
> so I added the few other steps to fully replicate the J code.
> 
> Thanks for your help, in any case.  I'm sure it will be useful to know about
> C/J interoperability at some point.
> 
> Devon
> 
> On 12/6/06, Oleg Kobchenko <[EMAIL PROTECTED]> wrote:
> >
> > This is helpful for the algorithic part.
> >
> > But I believe the original question was
> > C/J interop. So what's the example of that?
> >
> > --- Devon McCormick <[EMAIL PROTECTED]> wrote:
> >
> > > At its core, the problem is, e.g.
> > >
> > >    CBM=: (1 0 0 0 1 0);(1 1 0 1 0 0);(0 0 1 1 1 0);<0 1 0 1 0 1
> > >    CBM (+/ . *.)&>/ CBM
> > > 2 1 1 0
> > > 1 3 1 2
> > > 1 1 3 1
> > > 0 2 1 3
> > >
> > > but with CBM being much larger.
> > >
> > > On 12/5/06, Oleg Kobchenko <[EMAIL PROTECTED]> wrote:
> > > >
> > > >
> > > > --- Devon McCormick <[EMAIL PROTECTED]> wrote:
> > > >
> > > > > Dan -
> > > > >
> > > > > I'm working on a piece of the Netflix challenge.  Basically, I'd
> > like
> > > >
> > > > I believe the question was, what is a reasonably
> > > > general but concrete example that you need to
> > > > "C-code to process J array". Because it's a largely
> > > > wide area.
> > > >
> > > > It's hard to firgure it out from the whole program
> > > > with lots of unrelated details either.



 
____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to