Re: Re: Referencing a row in a two dimensional array

JP Massar <[email protected]>
Newsgroups gmane.lisp.corman
Message-ID <[email protected]>
At 10:05 AM 3/2/03 +1200, Chris Double wrote:
> >    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.


If you can turn the GC off at all, then why can't you turn it off for
an indefinite amount of time, as long as you never cons (i.e., allocate
memory), and insure that other threads can't run?

At some level you don't need to call Lisp functions to store items into
a Lisp array; at some level there is presumably just a pointer to a block
of memory which you can dump bytes into.

So the innermost innards of READ-SEQUENCE presumably could be
coded as:

(WITH-NO-INTERRUPTS
   (WITH-NO-GC
      {
         assembler code that does the equivalent of the C code
          for (j = 0; j < buf_end; j++)
           *lisp_array_ptr++ = *stream_buffer++;
       }

with appropriate pointer types for different data sizes, of course.

(Caveat:  I am almost totally ignorant of the inner workings of Corman
and Windows.  So if I am spouting nonsense don't be afraid to tell me
so, and why)




------------------------ 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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.