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

next in thread | previous in thread | raw e-mail | index | archive | help
rozhuk.im@gmail.com has reassigned Bugzilla Automation <bugzilla@FreeBSD.or=
g>'s
request for maintainer-feedback to gnome@FreeBSD.org:
Bug 214338: devel/glib20: patch: new kqueue() backend for file monitoring
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D214338



--- Description ---
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.



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