views:

54

answers:

2

I have an application that is multithreaded - one thread is responsible for collecting the dead children with wait(), anther thread spawns them with fork upon request.

I found out that on one platform with 2.4 kernel and LinuxThread wait always fails with ECHILD. I've found out that problem might be in non-POSIX compliant implementation of LinuxThreads on 2.4 kernel and the following discussion suggests that there is no way how this could be solved.

Still I'd like to be sure that nobody knows about any solution. Even patch for the kernel would be acceptable.

When I think about the application design I don't think it could be possible to do both fork() and wait() in a single thread (or only with enormous effort)

A: 

If you're starting to think about kernel patches, then it's time to think about upgrades. 2.4 is very long in the tooth.

Douglas Leeder
2.4 has definitely been out for a long time, but it is still favored by some embedded projects where the kernel image size is an issue. See http://denx.de/wiki/Know/Linux24vs26 for a size comparison on PPC. Personally, I'd upgrade to 2.6.x because the improvements out weigh the size increase, but that's just me.
ctuffli
And this was also the case. For the given platform, only 2.4 series are supported by the supplier unfortunately. It is painful in many other aspects.
ja.ro
+1  A: 
ja.ro