SV: Re: Referencing a row in a two dimensional array
"Pavel Grozman" <[email protected]>
| Newsgroups | gmane.lisp.corman |
|---|---|
| Message-ID | <[email protected]> |
> -----Ursprungligt meddelande----- > Fran: Chris Double [mailto:[email protected]] > Skickat: den 1 mars 2003 23:05 > Till: [email protected] > Amne: Re: [cormanlisp] Re: Referencing a row in a two dimensional array > > > > Out of curiosity, it is theoretically possible to do > (expressed in > > psuedocode): > > It is possible to turn off the garbage collector for very short periods > of time in assembler. The idea being when you are doing an 'unsafe' > operation you can turn it off and back on again a few instructions later. > This is explained in the Corman Lisp documentation if I recall correctly. > I'm not sure if it would help in this instance though since you need to > call Lisp functions to store items in the array and you can't do this > between the gc off/on commands. > > Chris. > -- > http://www.massivesoftware.com > -- > Chris Double > [email protected] It is not safe to call functions in this situation. There is another possibility: to use functions EnterCriticalSection and LeaveCriticalSection with the same parameter as they are called by garbage collector. CormanLispServer does not support this possibility, but it is easy to add such support. The function may look something like this: read the remaining data from stream buffer; call EnterCriticalSection(GCCriticalSection) to disable GC in other threads; call ReadFile; call LeaveCriticalSection(GCCriticalSection) to enable GC; modify the information in stream structure But this function may be effective only when reading large blocks. I think it is better to write functions for fast copying data in memory. It would made reading fast enough, will work with all types of streams (not only with file streams), and it may be used in many other places, e.g., subseq, copy-seq. If it is interesting for somebody, I can do it. I have already written fast functions for allocating arrays and accessing elements (aref, elt, char). I hope that they may be included in CCL. But they are not tested, and I cannot test myself how they work with different modules. And I do not know how I can organize the testing without violation Corman Lisp license (I have changed both CormanLispServer.dll and CormanLisp.img). Pavel Grozman ------------------------ Yahoo! Groups Sponsor ---------------------~--> Get 128 Bit SSL Encryption! http://us.click.yahoo.com/LIgTpC/vN2EAA/xGHJAA/SyjtlB/TM ---------------------------------------------------------------------~-> To unsubscribe from this group, send an email to: [email protected] Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/