On 2009-02-26, Frantisek Hrbata <frantisek.hrb...@avg.com> wrote:
> I experimentally added support for dazukofs to our upcoming avg8
> because I would like to make some performance comparison between
> dazukofs and avflt.

Nice. It would be great if you could post the results of your tests
here.

> After dazukofs integration to our scanner I have noticed that
> dazukofs_get_access returns a lots of -EINTR. I am using dazukofs in
> a multi-threaded scanner and this error occurs only when more then
> one thread is used. I wrote a simple showfiles_mt application using
> dazukofs in several threads just to check out if the problem is in
> my integration or in dazukofs. As I found out I can easily reproduce
> this behavior with showfiles_mt.

I am running a multi-threaded application without any such
problems. However, my implementation is a bit different then yours. I
will try to illustrate the difference here using a diff-like approach.

int main(void)
{
     ...
-    signal(SIGTERM, sigterm);
-    signal(SIGINT, sigterm);
+    sigset_t sigset;
+
+    /* detect TERM signals */
+    signal(SIGTERM, sigterm);
+    signal(SIGINT, sigterm);
+    signal(SIGHUP, sigterm);
+
+    /* ignore SIGUSR1 (only used by threads) */
+    if (sigemptyset(&sigset) == 0) {
+       sigaddset(&sigset, SIGUSR1);
+       sigprocmask(SIG_BLOCK, &sigset, NULL);
+    }

+    sigset_t sigset;
+    if (sigemptyset(&sigset) == 0) {
+       sigaddset(&sigset, SIGTERM);
+       sigaddset(&sigset, SIGINT);
+       sigaddset(&sigset, SIGHUP);
+       pthread_sigmask(SIG_BLOCK, &sigset, NULL);
+    }

 Also there is just a simple single process example
> shipped within dazukofs package so I am not sure if I am using it
> right. But as I peeked into the code I think my integration is ok. I
> wasn't digging very deep, but I am pretty sure the -ERESTARTSYS is
> returned by wait_event_freezable in dazukofs_get_event. I just can
> not see what(signal?) is interrupting it. Anyway I attached a patch
> for dazukofs-3.0.0 which adds showfiles_mt so you should be able to
> reproduce it.
>
> 1) copy dazukofs-3.0.0-showfiles_mt.patch into the dazukofs-3.0.0
>    source code
>
> 2) in the dazukofs-3.0.0 directory use
>    $ patch -p1 < dazukofs-3.0.0-showfiles_mt.patch
>
> 3) now you can use showfiles_mt in the same way as showfiles
>
> Could you please look at the showfiles_mt if my implementation is ok
> or if there is a bug in dazukofs?
>
> Thanx
>
> -FH 
>
> _______________________________________________
> Dazuko-devel mailing list
> Dazuko-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/dazuko-devel


_______________________________________________
Dazuko-devel mailing list
Dazuko-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/dazuko-devel

Reply via email to