I have asynchronous conversion of graphics files to a loadable format working 
here beautifully. They don't display, because I don't explicitly tell LyX 
that they've loaded (that ol' dispatch question). I have to enter something 
on the paragraph to force a redraw. Anyway, that's not the main point of this 
mail. This is:

I find that the conversion process works about 50% of the time. The rest of 
the time, the forked call controller thinks that the child dies and I get the 
message: "LyX: Error waiting for child:  No child processes". the relevant 
code is:

void ForkedcallsController::timer()
{
        ListType::size_type start_size = forkedCalls.size();

        for (ListType::iterator it = forkedCalls.begin();
             it != forkedCalls.end(); ++it) {
                Forkedcall * actCall = *it;

                pid_t pid = actCall->pid();
                int stat_loc;
                int const waitrpid = waitpid(pid, &stat_loc, WNOHANG);
                bool remove_it = false;

                if (waitrpid == -1) {
                        lyxerr << "LyX: Error waiting for child: " 
                               << strerror(errno) << endl;

                        // Child died, so pretend it returned 1
                        actCall->setRetValue(1);
                        remove_it = true;
                }
        }
}

Is there a knowledgeable person out there who can tell me what I'm doing 
wrong? Is it just that I'm not polling the process often enough? (The timer 
is currently set to 500ms.) Or is this symptomatic of something more serious?

Angus

Reply via email to