login
Header Space

 
 

Re: [RFC \ WISH] Add -o option to git-rev-list

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: Git Mailing List <git@...>, Josef Weidendorfer <Josef.Weidendorfer@...>, Junio C Hamano <junkio@...>, Alex Riesen <raa.lkml@...>, Shawn Pearce <spearce@...>
Date: Friday, December 15, 2006 - 4:41 pm

On 12/15/06, Linus Torvalds <torvalds@osdl.org> wrote:

QProcess implementation is like this FWIK (from
qt-x11-free-3.3.4/src/kernel/qprocess_unix.cpp):

The SIGCHLD handler writes to a socket to tell the manager that
something happened. Then in  QProcessManager::sigchldHnd() data is read by

process->socketRead( proc->socketStdout );


In QProcess::socketRead() a call to C function read() is done to get
4KB of data:

const int basize = 4096;
QByteArray *ba = new QByteArray( basize );
n = ::read( fd, ba->data(), basize );


The pointer ba is then appended to a pointer list.

This happens _ALWAYS_ indipendently of _how_ the application calls the
Qt library for reading.

When application read recieved data with QProcess::readStdout(), then
data stored in buffers pointed by the pointer list is memcpy() to a
temporary array that is the return value of QProcess::readStdout().
See in qt-x11-free-3.3.4/src/kernel/qprocess.cpp:

QByteArray QProcess::readStdout()
{
    if ( readStdoutCalled ) {
	return QByteArray();
    }
    readStdoutCalled = TRUE;
    QMembuf *buf = membufStdout();
    readStdoutCalled = FALSE;

    return buf->readAll();  // here a memcpy() is involved
}


So it' true that we use a timeout, but only to trigger a memcpy() from
Qt internal library buffers that, instead are feeded as soon as
possible by Qt implementation.

IOW the timely select() is already done by Qt library. We just read
what has been already received and stored.

   Marco

P.S: BTW reading on Qt "data ready" signal is slower the reading on timer.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC \ WISH] Add -o option to git-rev-list, Marco Costalba, (Sun Dec 10, 7:38 am)
Re: [RFC \ WISH] Add -o option to git-rev-list, Linus Torvalds, (Sun Dec 10, 2:16 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Marco Costalba, (Sun Dec 10, 3:51 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Andreas Ericsson, (Mon Dec 11, 7:39 am)
Re: [RFC \ WISH] Add -o option to git-rev-list, Marco Costalba, (Mon Dec 11, 8:59 am)
Re: [RFC \ WISH] Add -o option to git-rev-list, Andreas Ericsson, (Mon Dec 11, 9:40 am)
Re: [RFC \ WISH] Add -o option to git-rev-list, Linus Torvalds, (Sun Dec 10, 4:08 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Linus Torvalds, (Sun Dec 10, 4:19 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Marco Costalba, (Sun Dec 10, 6:05 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Linus Torvalds, (Sun Dec 10, 6:16 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Marco Costalba, (Sun Dec 10, 6:35 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Linus Torvalds, (Sun Dec 10, 6:53 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Marco Costalba, (Sun Dec 10, 8:15 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Josef Weidendorfer, (Mon Dec 11, 5:26 am)
Re: [RFC \ WISH] Add -o option to git-rev-list, Marco Costalba, (Mon Dec 11, 8:52 am)
Re: [RFC \ WISH] Add -o option to git-rev-list, Josef Weidendorfer, (Mon Dec 11, 9:28 am)
Re: [RFC \ WISH] Add -o option to git-rev-list, Marco Costalba, (Mon Dec 11, 1:28 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Linus Torvalds, (Sun Dec 10, 8:51 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Marco Costalba, (Mon Dec 11, 3:17 am)
Re: [RFC \ WISH] Add -o option to git-rev-list, Linus Torvalds, (Mon Dec 11, 12:59 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Linus Torvalds, (Mon Dec 11, 1:07 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Marco Costalba, (Mon Dec 11, 1:39 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Linus Torvalds, (Mon Dec 11, 2:15 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Marco Costalba, (Mon Dec 11, 2:59 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Josef Weidendorfer, (Mon Dec 11, 4:28 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Linus Torvalds, (Mon Dec 11, 4:40 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Josef Weidendorfer, (Mon Dec 11, 4:54 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Linus Torvalds, (Mon Dec 11, 5:14 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Marco Costalba, (Fri Dec 15, 2:45 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Linus Torvalds, (Fri Dec 15, 3:20 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Marco Costalba, (Fri Dec 15, 4:41 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Marco Costalba, (Fri Dec 15, 5:04 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Linus Torvalds, (Mon Dec 11, 3:25 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Alex Riesen, (Mon Dec 11, 6:00 am)
Re: [RFC \ WISH] Add -o option to git-rev-list, Marco Costalba, (Sun Dec 10, 6:09 pm)
globs in partial checkout?, Michael S. Tsirkin, (Sun Dec 10, 4:00 pm)
Re: globs in partial checkout?, Linus Torvalds, (Sun Dec 10, 4:13 pm)
Re: globs in partial checkout?, Michael S. Tsirkin, (Sun Dec 10, 5:07 pm)
Re: [RFC \ WISH] Add -o option to git-rev-list, Alex Riesen, (Sun Dec 10, 10:54 am)
speck-geostationary