Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Nov 2016 21:15:40 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 214338] devel/glib20: patch: new kqueue() backend for file monitoring
Message-ID:  <bug-214338-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D214338

            Bug ID: 214338
           Summary: devel/glib20: patch: new kqueue() backend for file
                    monitoring
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Keywords: patch
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: gnome@FreeBSD.org
          Reporter: rozhuk.im@gmail.com
          Keywords: patch
             Flags: maintainer-feedback?(gnome@FreeBSD.org)
          Assignee: gnome@FreeBSD.org

Created attachment 176801
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D176801&action=
=3Dedit
kqueue() file monitoring backend

Original kqueue() file monitor uses polling to monitor files in /mnt and all
path that can be unmounted.
On my system thunar eat 100% CPU after short time browsing sshfs, smbfs sha=
res.
But on Apple MAC (where defined O_EVTONLY) kqueue() always used.

My code based on FAM backend (
https://github.com/GNOME/glib/blob/master/gio/fam/gfamfilemonitor.c ):
- no additional threads created
- no hash tables used
- lock() only in few placed: on init and on kqueue() events process (may be
this can be removed, I m not sure how glib process read events)
- small and simple code: ~500 lines, that easy to understand and debug with=
out
glib

If you have some sshfs/smb mount point and some one (not from your host) ch=
ange
files there - no notifications will be received: kqueue() does not handle i=
t.
Original code use polling.
Im not sure does inotify, fam, kqueue() on apple mac and others handle it.

I can add polling by timer but it may take many CPU resources, like glib ba=
sed
polling in original kqueue backend.


I need your opinions and feedback.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-214338-13>