Re: SIGCHLD: how to do this for Qt?

2004-03-25 Thread Angus Leeming
On Tuesday 23 March 2004 6:55 pm, John Levon wrote: On Tue, Mar 23, 2004 at 06:46:12PM +, Angus Leeming wrote: Why don't you like while (!finished) { someNonTrivialFunction(); if (fl_check_forms() == FL_EVENT) { ... } } (I guess

Re: SIGCHLD: how to do this for Qt?

2004-03-25 Thread Angus Leeming
On Tuesday 23 March 2004 6:55 pm, John Levon wrote: > On Tue, Mar 23, 2004 at 06:46:12PM +, Angus Leeming wrote: > > Why don't you like > > while (!finished) { > > someNonTrivialFunction(); > > if (fl_check_forms() == FL_EVENT) { > > ... > > } > > }

Re: SIGCHLD: how to do this for Qt?

2004-03-24 Thread Alfredo Braunstein
John Levon wrote: John, have a medal! Thank you! Does this mean Alfredo doesn't hate me any more? Because of a medal? I you take your medaled royal ass back here and start coding I may stop ;-) Alfredo

Re: SIGCHLD: how to do this for Qt?

2004-03-24 Thread John Levon
On Wed, Mar 24, 2004 at 09:05:47AM +0100, Alfredo Braunstein wrote: John, have a medal! Thank you! Does this mean Alfredo doesn't hate me any more? Because of a medal? I you take your medaled royal ass back here and start coding I may stop ;-) I'm an award winner, I don't need to

Re: SIGCHLD: how to do this for Qt?

2004-03-24 Thread Andre Poenitz
On Wed, Mar 24, 2004 at 01:13:30AM +, John Levon wrote: On Tue, Mar 23, 2004 at 08:14:57PM +, Angus Leeming wrote: What ever happened to the quote of the month? ;-) Hmm, I stopped doing it. But I may well restart for my own benefit! John, have a medal! Thank you! Does this

Meeting? [was: SIGCHLD: how to do this for Qt?]

2004-03-24 Thread Alfredo Braunstein
Andre Poenitz wrote: Does this mean Alfredo doesn't hate me any more? I always wondered why Alfredo suddenly played that Hating John part of the game. He's supposed to be in the Nice Guy camp... But but but... he started it first when nobody was looking! ;-) Seriously, are there any news

Re: SIGCHLD: how to do this for Qt?

2004-03-24 Thread Kuba Ober
Tell you what. The amount of time this discussion has taken so far I presume is comparable to what it takes to use the working and tested QProcess. And this will work on Windows (for those who compile LyX with Qt/Win) as well. What's so bad about QProcess? No offense meant :) Cheers, Kuba

Re: SIGCHLD: how to do this for Qt?

2004-03-24 Thread Angus Leeming
Kuba Ober wrote: Tell you what. The amount of time this discussion has taken so far I presume is comparable to what it takes to use the working and tested QProcess. And this will work on Windows (for those who compile LyX with Qt/Win) as well. What's so bad about QProcess? You really want

Re: SIGCHLD: how to do this for Qt?

2004-03-24 Thread Kuba Ober
On Wednesday 24 March 2004 10:34 am, Angus Leeming wrote: Kuba Ober wrote: Tell you what. The amount of time this discussion has taken so far I presume is comparable to what it takes to use the working and tested QProcess. And this will work on Windows (for those who compile LyX with

Re: SIGCHLD: how to do this for Qt?

2004-03-24 Thread Alfredo Braunstein
John Levon wrote: >> John, have a medal! Thank you! > > Does this mean Alfredo doesn't hate me any more? Because of a medal? I you take your medaled royal ass back here and start coding I may stop ;-) Alfredo

Re: SIGCHLD: how to do this for Qt?

2004-03-24 Thread John Levon
On Wed, Mar 24, 2004 at 09:05:47AM +0100, Alfredo Braunstein wrote: > >> John, have a medal! Thank you! > > > > Does this mean Alfredo doesn't hate me any more? > > Because of a medal? I you take your medaled royal ass back here and start > coding I may stop ;-) I'm an award winner, I don't

Re: SIGCHLD: how to do this for Qt?

2004-03-24 Thread Andre Poenitz
On Wed, Mar 24, 2004 at 01:13:30AM +, John Levon wrote: > On Tue, Mar 23, 2004 at 08:14:57PM +, Angus Leeming wrote: > > > What ever happened to the quote of the month? ;-) > > Hmm, I stopped doing it. But I may well restart for my own benefit! > > > John, have a medal! Thank you! > >

Meeting? [was: SIGCHLD: how to do this for Qt?]

2004-03-24 Thread Alfredo Braunstein
Andre Poenitz wrote: >> Does this mean Alfredo doesn't hate me any more? > > I always wondered why Alfredo suddenly played that Hating John part of > the game. He's supposed to be in the Nice Guy camp... But but but... he started it first when nobody was looking! ;-) Seriously, are there any

Re: SIGCHLD: how to do this for Qt?

2004-03-24 Thread Kuba Ober
Tell you what. The amount of time this discussion has taken so far I presume is comparable to what it takes to use the working and tested QProcess. And this will work on Windows (for those who compile LyX with Qt/Win) as well. What's so bad about QProcess? No offense meant :) Cheers, Kuba

Re: SIGCHLD: how to do this for Qt?

2004-03-24 Thread Angus Leeming
Kuba Ober wrote: > Tell you what. The amount of time this discussion has taken so far I > presume is comparable to what it takes to use the working and tested > QProcess. And this will work on Windows (for those who compile LyX > with Qt/Win) as well. > > What's so bad about QProcess? You

Re: SIGCHLD: how to do this for Qt?

2004-03-24 Thread Kuba Ober
On Wednesday 24 March 2004 10:34 am, Angus Leeming wrote: > Kuba Ober wrote: > > Tell you what. The amount of time this discussion has taken so far I > > presume is comparable to what it takes to use the working and tested > > QProcess. And this will work on Windows (for those who compile LyX > >

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread Angus Leeming
John Levon wrote: On Mon, Mar 22, 2004 at 10:00:22PM +, Angus Leeming wrote: We only need to reap children every 10 minutes or whatever Then we go back to the timer and the whole thing has been a waste of time? Why do you say that? It's completely normal and expected practice.

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread John Levon
On Tue, Mar 23, 2004 at 08:53:55AM +, Angus Leeming wrote: I don't think you've read my proposed code. I'm pretty sure it's Maybe I just misread it (and now it's deleted). We drop out of the Qt loop to check the sigatomic_t. If it's set, then we go and reap the child, secure that

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread Angus Leeming
John Levon wrote: Angus, this has *nothing* to do with second signals. Yes, we need to take care of that issue, but it's not what I'm talking about. This is about interrupting *non-signal context* code. Sorry about the tone of that mail. I think I got out of the wrong side of bed this

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread John Levon
On Tue, Mar 23, 2004 at 04:02:55PM +, Angus Leeming wrote: Details follow below. Please try and rip it to shreds. Can't pick a hole in it. Looks fine to me cheers john

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread Angus Leeming
John Levon wrote: On Tue, Mar 23, 2004 at 04:02:55PM +, Angus Leeming wrote: Details follow below. Please try and rip it to shreds. Can't pick a hole in it. Looks fine to me Magic. One thing I have been wondering about though. Why don't you like while (!finished) {

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread Angus Leeming
On Tuesday 23 March 2004 7:13 pm, John Levon wrote: On Tue, Mar 23, 2004 at 07:06:30PM +, Angus Leeming wrote: Maybe I misunderstood what you wanted to change in Qt. A busy loop would be one that chewed CPU despite no events arriving. This is what seems to happen in the

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread John Levon
On Tue, Mar 23, 2004 at 07:38:48PM +, Angus Leeming wrote: Me too, if only because hacking into the Qt event loop turns out to be a right PITA. Nonetheless, playing devil's advocate, why is Strategy 2 better than the existing strategy of using a Timeout to reap the children also?

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread Angus Leeming
On Tuesday 23 March 2004 8:07 pm, John Levon wrote: On Tue, Mar 23, 2004 at 07:38:48PM +, Angus Leeming wrote: Me too, if only because hacking into the Qt event loop turns out to be a right PITA. Nonetheless, playing devil's advocate, why is Strategy 2 better than the existing

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread John Levon
On Tue, Mar 23, 2004 at 07:06:30PM +, Angus Leeming wrote: Maybe I misunderstood what you wanted to change in Qt. A busy loop would be one that chewed CPU despite no events arriving. This is what seems to happen in the Qt-equivalent. We get a never-ending stream of calls to

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread John Levon
On Tue, Mar 23, 2004 at 06:46:12PM +, Angus Leeming wrote: Why don't you like while (!finished) { someNonTrivialFunction(); if (fl_check_forms() == FL_EVENT) { ... } } (I guess that this is what you call a 'busy loop'?) I think this is

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread John Levon
On Tue, Mar 23, 2004 at 08:14:57PM +, Angus Leeming wrote: What ever happened to the quote of the month? ;-) Hmm, I stopped doing it. But I may well restart for my own benefit! John, have a medal! Thank you! Does this mean Alfredo doesn't hate me any more? john -- Spammers get STABBED

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread Angus Leeming
John Levon wrote: > On Mon, Mar 22, 2004 at 10:00:22PM +, Angus Leeming wrote: > >> > We only need to reap children every 10 minutes or whatever >> >> Then we go back to the timer and the whole thing has been a waste >> of time? > > Why do you say that? It's completely normal and expected

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread John Levon
On Tue, Mar 23, 2004 at 08:53:55AM +, Angus Leeming wrote: > I don't think you've read my proposed code. I'm pretty sure it's Maybe I just misread it (and now it's deleted). > > We drop out of the Qt loop to check the sigatomic_t. > > If it's set, then we go and reap the child, secure

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread Angus Leeming
John Levon wrote: > Angus, this has *nothing* to do with "second signals". Yes, we need > to take care of that issue, but it's not what I'm talking about. > This is about interrupting *non-signal context* code. Sorry about the tone of that mail. I think I got out of the wrong side of bed this

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread John Levon
On Tue, Mar 23, 2004 at 04:02:55PM +, Angus Leeming wrote: > Details follow below. Please try and rip it to shreds. Can't pick a hole in it. Looks fine to me cheers john

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread Angus Leeming
John Levon wrote: > On Tue, Mar 23, 2004 at 04:02:55PM +, Angus Leeming wrote: > >> Details follow below. Please try and rip it to shreds. > > Can't pick a hole in it. Looks fine to me Magic. One thing I have been wondering about though. Why don't you like while (!finished) {

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread Angus Leeming
On Tuesday 23 March 2004 7:13 pm, John Levon wrote: > On Tue, Mar 23, 2004 at 07:06:30PM +, Angus Leeming wrote: > > > Maybe I misunderstood what you wanted to change in Qt. A "busy > > > loop" would be one that chewed CPU despite no events arriving. > > > > This is what seems to happen in

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread John Levon
On Tue, Mar 23, 2004 at 07:38:48PM +, Angus Leeming wrote: > Me too, if only because hacking into the Qt event loop turns out to be > a right PITA. > > Nonetheless, playing devil's advocate, why is Strategy 2 better than > the existing strategy of using a Timeout to reap the children also?

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread Angus Leeming
On Tuesday 23 March 2004 8:07 pm, John Levon wrote: > On Tue, Mar 23, 2004 at 07:38:48PM +, Angus Leeming wrote: > > Me too, if only because hacking into the Qt event loop turns out > > to be a right PITA. > > > > Nonetheless, playing devil's advocate, why is Strategy 2 better > > than the

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread John Levon
On Tue, Mar 23, 2004 at 07:06:30PM +, Angus Leeming wrote: > > Maybe I misunderstood what you wanted to change in Qt. A "busy > > loop" would be one that chewed CPU despite no events arriving. > > This is what seems to happen in the Qt-equivalent. We get a > never-ending stream of calls to

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread John Levon
On Tue, Mar 23, 2004 at 06:46:12PM +, Angus Leeming wrote: > Why don't you like > while (!finished) { > someNonTrivialFunction(); > if (fl_check_forms() == FL_EVENT) { > ... > } > } > > (I guess that this is what you call a 'busy loop'?) I think

Re: SIGCHLD: how to do this for Qt?

2004-03-23 Thread John Levon
On Tue, Mar 23, 2004 at 08:14:57PM +, Angus Leeming wrote: > What ever happened to the quote of the month? ;-) Hmm, I stopped doing it. But I may well restart for my own benefit! > John, have a medal! Thank you! Does this mean Alfredo doesn't hate me any more? john -- "Spammers get

SIGCHLD: how to do this for Qt?

2004-03-22 Thread Angus Leeming
The xforms event loop in my tree now looks like: while (!finished) { ForkedcallsController::get().handleCompletedProcesses(); if (fl_check_forms() == FL_EVENT) { ... } } where handleCompletedProcesses() simply checks whether a SIGCHLD signal has been

Re: SIGCHLD: how to do this for Qt?

2004-03-22 Thread Kuba Ober
The xforms event loop in my tree now looks like: while (!finished) { ForkedcallsController::get().handleCompletedProcesses(); if (fl_check_forms() == FL_EVENT) { ... } } where handleCompletedProcesses() simply checks whether a SIGCHLD signal

Re: SIGCHLD: how to do this for Qt?

2004-03-22 Thread Angus Leeming
Kuba Ober wrote: The xforms event loop in my tree now looks like: while (!finished) { ForkedcallsController::get().handleCompletedProcesses(); if (fl_check_forms() == FL_EVENT) { ... } } where handleCompletedProcesses() simply checks whether a

Re: SIGCHLD: how to do this for Qt?

2004-03-22 Thread John Levon
On Mon, Mar 22, 2004 at 06:54:15PM +, Angus Leeming wrote: It turns out that QEventLoop exists only for Qt = 3.1. I'm running RH8 here (Qt 3.0.5). For Qt 3.1, the trick seems to be to use a QTimer with 0 timeout. That *does* work. Excuse me if I'm misunderstanding, is this going to

Re: SIGCHLD: how to do this for Qt?

2004-03-22 Thread Angus Leeming
John Levon wrote: On Mon, Mar 22, 2004 at 06:54:15PM +, Angus Leeming wrote: It turns out that QEventLoop exists only for Qt = 3.1. I'm running RH8 here (Qt 3.0.5). For Qt 3.1, the trick seems to be to use a QTimer with 0 timeout. That *does* work. Excuse me if I'm misunderstanding,

Re: SIGCHLD: how to do this for Qt?

2004-03-22 Thread John Levon
On Mon, Mar 22, 2004 at 10:00:22PM +, Angus Leeming wrote: We only need to reap children every 10 minutes or whatever Then we go back to the timer and the whole thing has been a waste of time? Why do you say that? It's completely normal and expected practice. It is trivially easy to

SIGCHLD: how to do this for Qt?

2004-03-22 Thread Angus Leeming
The xforms event loop in my tree now looks like: while (!finished) { ForkedcallsController::get().handleCompletedProcesses(); if (fl_check_forms() == FL_EVENT) { ... } } where handleCompletedProcesses() simply checks whether a SIGCHLD signal has been

Re: SIGCHLD: how to do this for Qt?

2004-03-22 Thread Kuba Ober
> The xforms event loop in my tree now looks like: > > while (!finished) { > ForkedcallsController::get().handleCompletedProcesses(); > if (fl_check_forms() == FL_EVENT) { > ... > } > } > > where handleCompletedProcesses() simply checks whether a SIGCHLD

Re: SIGCHLD: how to do this for Qt?

2004-03-22 Thread Angus Leeming
Kuba Ober wrote: >> The xforms event loop in my tree now looks like: >> >> while (!finished) { >> ForkedcallsController::get().handleCompletedProcesses(); >> if (fl_check_forms() == FL_EVENT) { >> ... >> } >> } >> >> where handleCompletedProcesses()

Re: SIGCHLD: how to do this for Qt?

2004-03-22 Thread John Levon
On Mon, Mar 22, 2004 at 06:54:15PM +, Angus Leeming wrote: > It turns out that QEventLoop exists only for Qt >= 3.1. I'm running > RH8 here (Qt 3.0.5). For Qt < 3.1, the trick seems to be to use a > QTimer with 0 timeout. That *does* work. Excuse me if I'm misunderstanding, is this going

Re: SIGCHLD: how to do this for Qt?

2004-03-22 Thread Angus Leeming
John Levon wrote: > On Mon, Mar 22, 2004 at 06:54:15PM +, Angus Leeming wrote: > >> It turns out that QEventLoop exists only for Qt >= 3.1. I'm running >> RH8 here (Qt 3.0.5). For Qt < 3.1, the trick seems to be to use a >> QTimer with 0 timeout. That *does* work. > > Excuse me if I'm

Re: SIGCHLD: how to do this for Qt?

2004-03-22 Thread John Levon
On Mon, Mar 22, 2004 at 10:00:22PM +, Angus Leeming wrote: > > We only need to reap children every 10 minutes or whatever > > Then we go back to the timer and the whole thing has been a waste of > time? Why do you say that? It's completely normal and expected practice. > It is trivially