Stackless, thread paradigm and C extensions
mwh at python.net
Mon Nov 12 11:32:00 CET 2001
"Frederic Giacometti" <frederic.giacometti at arakne.com> writes:
> "Michael Hudson" <mwh at python.net> wrote in message
> news:u4ro58kzx.fsf at python.net...
> > "Frederic Giacometti" <frederic.giacometti at arakne.com> writes:
> > [schnipp]
> > > Does this make sense?
> > But isn't the point of many multithreaded apps allowing code to run
> > during blocking IO operations? Your approach would knock that on the
> > head.
> In the proposed design, stackless call to another thread never
> blocks the thread; it inserts a frame in one of the thread frame
> schedulers. Just as all C functions external to the Python
> interpreter core, IO functions run outside the interpreter thread.
I must be missing something. Can you sketch how, say, socket.send()
would be implemented? Would you spawn a new OS thread for every C API
call? I'm afraid I don't understand you to this point...
BUGS Never use this function. This function modifies its first
argument. The identity of the delimiting character is
lost. This function cannot be used on constant strings.
-- the glibc manpage for strtok(3)
More information about the Python-list