From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,15edb893ef79e231 X-Google-Attributes: gid103376,public X-Google-Thread: f4fd2,23202754c9ce78dd X-Google-Attributes: gidf4fd2,public X-Google-Thread: fac41,15edb893ef79e231 X-Google-Attributes: gidfac41,public X-Google-Thread: 114809,15edb893ef79e231 X-Google-Attributes: gid114809,public X-Google-ArrivalTime: 2002-02-13 13:17:05 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: tshawke@qwest.com (Tom Hawker) Newsgroups: comp.lang.lisp,comp.lang.ada,comp.lang.eiffel,comp.lang.smalltalk Subject: Re: True faiths ( was Re: The true faith ) Date: 13 Feb 2002 13:17:05 -0800 Organization: http://groups.google.com/ Message-ID: <43d7620c.0202131317.76a5c353@posting.google.com> References: <3C4DE336.3080102@worldnet.att.net> NNTP-Posting-Host: 207.225.133.18 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1013635025 21827 127.0.0.1 (13 Feb 2002 21:17:05 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 13 Feb 2002 21:17:05 GMT Xref: archiver1.google.com comp.lang.lisp:26463 comp.lang.ada:19976 comp.lang.eiffel:5673 comp.lang.smalltalk:19576 Date: 2002-02-13T21:17:05+00:00 List-Id: dkcombs@panix.com (David Combs) wrote in message news:... > > QUESTION: what kind of solutions are there to > this problem? > > What are some more, er, robust approaches? > > Thanks! > > David Try a different language. The Cincom Smalltalk implementation allows access to C calls (which, of course, will get you to C++ if you're careful). The function must reside in a shared library that loads into the Smalltalk address space and can access -- through controls -- object memory. Object memory runs under the GC; accessing an object from C "locks" it so it doesn't get collected or moved on you. Dynamic memory allocation from C (or C++) uses the standard malloc() calls. I know that some Smalltalk implementations (such as GNU) actually have a private version of the malloc routines (same semantics) to control memory zones. The interface is rather flexible, supporting semantics to create objects that look like C structures internally and are converted to native C structures on function invocation. The invocation will even permit spawning the function as a thread, but there are more restrictions placed on those. The calling mechanism uses C's pass-by-value semantics. But since you can pass object references (OOPs), you have access to everything else as well. There is some support for semaphores, but I think it's rather limited. Thunking, or a reverse call from C to Smalltalk, is possible using Smalltalk blocks, but I do not know how this is handled. -- Tom