Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!apple!oliveb!pyramid!prls!philabs!ppgbms!paul From: paul@ppgbms (Paul Evan Matz) Newsgroups: comp.windows.news Subject: Re: C Client arrays Summary: Comments on Example for sending array data from client to server Keywords: array_data NeWS Message-ID: <659@ppgbms.UUCP> Date: 5 Mar 89 21:23:03 GMT References: <8903010054.AA06125@bill.capmkt.com> Reply-To: ppgbms!moe!paul@philabs.philips.com (Paul Evan Matz) Distribution: na Organization: PPG Biomedical Sys., Pleasantville, NY. Lines: 46 In article <8903010054.AA06125@bill.capmkt.com> tim@capmkt.UUCP writes: > >/*** the cps defs ***/ > >cdef arraystart() > [ > >cdef arrayend() > ] > >cdef emit_double(double val) > val > You might want to build into the cdef functions the array identifier assignment part too, like: cdef arraystart() ArrayDataName [ cdef arrayend() ] def One *VERY* big problem with this method is that the array data is being put on the stack of the server side liteweight process, so if you're trying to pass an array bigger than 1000 words, look out for a stack overflow! (I've heard there is a way to increase the stack size, but have never found out how). Another problem with this method is that the data being passed is translated into ascii by the client, sent on the byte stream connection to the server, who then translates it back to binary whatever. Kinda slow. Depending on what you are doing with the data, it is sometimes better to use some of the cdef intrinsics like ps_moveto, ps_lineto; I think the passed parameters are tokenized in an XDR-like way (I can't remember where I read this. I could be completely off base on this, but I don't think so). Maybe Sun will provide a decent binary array transmission mechanism in the X11/NeWS merge. Anybody care to comment? Paul Matz PPG Biomedical Systems One Campus Drive Pleasantville, NY. 10570 914-741-4685 path ppgbms!moe!paul@philabs.philips.com