[Python-Dev] pre-PEP: The Safe Buffer Interface

Scott Gilbert xscottg@yahoo.com
Tue, 30 Jul 2002 23:29:50 -0700 (PDT)


--- Neil Hodgson <nhodgson@bigpond.net.au> wrote:
> 
>    Since Scintilla is a component within a user interface, it shares this
> responsibility with the container application with the application being
> the main determinant. If I was writing a Windows-specific application
that
> used Scintilla, and I wanted to use Asynchronous I/O then my preferred
> technique would be to change the message processing loop to leave the UI
> input messages in the queue until the I/O had completed.
>    Once the I/O had completed then the message loop would change back to
> processing all messages which would allow the banked up input to come
> through.
>

Cool.  This is what I was looking for.  It's a tad complicated, but it
makes a bit of sense.

Is there anything in here that can't be done if you only had the simple (no
locking) version of the fixed buffer interface?

> 
> > A single lock interface can be implemented over an object without any
> > locking.  Have the lockable object return simple "fixed buffer objects"
> > with a limited lifespan.
> 
>    This returns to the possibility of indeterminate lifespan as mentioned
> earlier in the thread.
> 

Not if you add an explicit release() method.  Just like the file object has
an explicit close() method.  Your object with the locking smarts could just
return "snapshot" views with an explicit release() method on them.

>
> > At which point I wonder what using asynchronous I/O achieved since the
> > resize operation had to wait synchronously for the I/O to complete. 
> > This also sounds suspiciously like blocking the resize thread, but I
> > won't argue that point.
> 
>    There may be other tasks that the application can perform while
> waiting for the I/O to complete, such as displaying, styling or line-
> wrapping whatever text has already arrived (assuming that there are some
> facilities for discovering this) or performing similar tasks for other
> windows.
>

All good points.  Thank you for indulging me.  Sorry to be such a PITA.


Cheers,
    -Scott






__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com