
Hi, one thing that I gleaned from Matthias's strace output is the fcntl system calls to obtain the locks. They are not really needed for my application and could be avoided using the POSIX library. However, this does not seem to be a big issue just from the cost of the system calls, because there is no noticeable difference between Matthias's C programs.
But it sounds like in your case you need to open lots of (small?) files. What do you do with the contents of the files?
Yes, the files are small. They typically contain less than 10 words. These words are key words and the Select program selects file names based on boolean expressions formed from the key words. What I'm actually doing is implementing a data base for email messages, where these file names are the primary keys for the messages. Each message is represented by two files of the same name (but in different directories), the data file containing the raw message, and the meta data file that just contains a list of key words. Keeping the meta data in this way allows for smooth interaction with file synchronization across several computers. So it's necessary that each set of key words resides in its own file. I have created a web page with a little more argumentation about it: http://www.informatik.uni-freiburg.de/~thiemann/MailStore The downloadables may be a bit out of date, but you get the idea. Hope that helps. -Peter

I have a problem with c_sigprocmask from the Posix library. This is supposed to set a signal mask for the process (but it appears it actually only sets it for the thread). I need some way of calling sigprocmask before the garbage collector thread is started so it inherits the same signal mask (or a way of setting the signal mask of the garbage collector whilst running). Any ideas? Regards, Keean Schupke.

I am trying to block the SIGPIPE signal, I have used the Posix sigprocmask call to set the signal to blocked. However the program sill bails out if the client closes its socket. The exception handler appears to be called then the program terminates. When I run the program in gdb, it gives a SIGPIPE signal just after the thread swap happens... Heres the report from gdb: Starting program: /local/home/keean/HServer/hserver (no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...[New Thread 16384 (LWP 23152)] (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)... Server Start serverMain Connection from: "xxx.xxx.xxx.xxx":1054 caught thread exception application finally Connection from: "xxx.xxx.xxx.xxx":1055 caught thread exception application finally : : Connection from: "pc-80-192-247-253-cr.blueyonder.co.uk":1104 (no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)... Program received signal SIGPIPE, Broken pipe. [Switching to Thread 16384 (LWP 23152)] 0x4015b8cd in sigprocmask () from /lib/libc.so.6 So there is a real thread, what I cant quite figure out is why it dies in sigprocmask ()... Regards, Keean Schupke -----Original Message----- From: Wolfgang Thaller [mailto:wolfgang.thaller@gmx.net] Sent: 10 January 2003 19:20 To: Keean Schupke Subject: Re: signal masks and garbage collection. Keean Schupke wrote:
I have a problem with c_sigprocmask from the Posix library. This is supposed to set a signal mask for the process (but it appears it actually only sets it for the thread). I need some way of calling sigprocmask before the garbage collector thread is started so it inherits the same signal mask (or a way of setting the signal mask of the garbage collector whilst running). Any ideas?
The garbage collector in GHC doesn't currenlty run in a separate thread - it is executed in the same thread as your haskell code (even if you use the "threaded RTS"). Therefore there is no separate signal mask for the garbage collector. What are you trying to do? Regards, Wolfgang Thaller
participants (3)
-
Keean
-
Keean Schupke
-
Peter Thiemann