Mailinglist Archive: opensuse-programming (51 mails)

< Previous Next >
Re: [suse-programming-e] threads and file descriptors
  • From: Jerry Feldman <gaf@xxxxxxx>
  • Date: Mon, 8 May 2006 10:38:26 -0400
  • Message-id: <200605081038.27106.gaf@xxxxxxx>
On Monday 08 May 2006 8:39 am, Per Jessen wrote:
> I had to go quite far back to find the pipe() call that gives me a set
> of 13 and 14.

> I was hoping strace would do it for me, but it might be better just
> doing it myself.
It is tedious to do this, but you really need to track every open(2) and
close(2). You also have a complicated system where you are using BOTH
threads and forks.
Be very careful of using fork(2) from threads. To quote from Dave Butenhof,
"Avoid using forkin a threaded program (if you can) unless you intend to
exec a new program immediately".
Page 197 "Programming with POSIX Threads".
I can personally attest for David being a good authority on Pthreads.
Jerry Feldman <gaf@xxxxxxx>
Boston Linux and Unix user group PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9

< Previous Next >
List Navigation