fam
[Top] [All Lists]

Re: Directories limit

To: "Stanislav V. Razoumnyi" <1rsv@xxxxxxx>
Subject: Re: Directories limit
From: Alexander Larsson <alexl@xxxxxxxxxx>
Date: Tue, 1 Oct 2002 04:44:10 -0400 (EDT)
Cc: fam@xxxxxxxxxxx
In-reply-to: <852226441.20020929163733@xxxxxxxxxxx>
Sender: fam-bounce@xxxxxxxxxxx
On Sun, 29 Sep 2002, Stanislav V. Razoumnyi wrote:

> Hello fam,
> 
> Im using known perl script by Atif Ghaffar <atif@xxxxxxxxxxxx> to monitor
> lots of dirs. But the problem is that I cant monitor more then 248
> dirs using that script. On 249th it just hangs. I thought that bug can
> be in Fam Perl module, so I decided to use c++ program. I modified
> test.c++ file included in the FAM package. So now it has additional
> key '-l'.If use that key it'l take list of dirs to monitor from file
> dirlist.txt (attached). When I run that modified test.c++, I got more
> or less the same result (hangs after 256 dir)as using perl script. So I 
> decided that Fam
> perl module is out of the problem. Than I started Fam with debug keys
> and tried perl script and then test.c++ again. The result was
> absolutely the same: Fam in it's messages said that it's monitoring
> needed dirs but only till request number 90. After that it stops
> showing any debug messages although perl script or test.c++ send to
> Fam more than 90 dirs to monitor.
> 
> Tried on RH Linux 7.3(2.4.18) and Mandrake Linux 8.2 (2.4.18)
> 
> Included files:
> fam_sync.pl - perl script to monitor lots of dirs
> test.c++    - modified to monitor lots of dirs
> dirlist.txt - my directory structure
> scandirs.pl - perl script to create dirlist.txt for any directory,
> usage: scandirs.pl yourdirname  
> Take them here:
> ftp://cypress.ie.tusur.ru/incoming/4fam/dirlimit.zip

I didn't look at your code, but this sounds like an old problem we've seen 
in the Gnome project to. What you're seeing is a deadlock. When you 
request to monitor a directory fam will send events back to you, and if 
you continue to do this while not reading events from fam the pipe from 
fam->your_app will become full. At this point fam ignores further requests 
from you, because it would block trying to send the response anyway. After 
a while you will block on your pipe being full too.

The solution is to keep processing fam events while requesting 
notification.
 
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl@xxxxxxxxxx    alla@xxxxxxxxxxxxxx 
He's a short-sighted playboy househusband fleeing from a secret government 
programme. She's a disco-crazy Bolivian angel who can talk to animals. They 
fight crime! 


<Prev in Thread] Current Thread [Next in Thread>
  • Re: Directories limit, Alexander Larsson <=