Open Russtopia opened 2 years ago
Just looking at the edif.cc
source quickly, I didn't find any sleep() or usleep() calls, or select()-like calls to wait on editor file handle; could there be a busy loop somewhere awaiting the editor to return or its file to be closed that might be taking up the CPU?
I didn't really study the logic properly though, so my apologies if this is a red herring.
No, there's no busy-loop, at least not in my code, but I use inotify to detect when the edited APL file is changed. I haven't a clue what goes on under the covers in that, but it wouldn't surprise me if resulted in a fair amount of kernel arm-waving.
The process spawning, IPC/message-passing, etc, in edif is pretty messy--in a sense I'm having to do a bit of kernel work without being in the kernel. If you're interested, I've got another APL toy coming out, probably before the end of the year, that provides a cleaner, more flexible, edif-like interface to emacs, gvim, or, likely, whatever. (The new thing is Qt-based, not an APL native function, and handles processes in Qt's event loop for close to zero additional overhead,)
On 11/27/21 01:30, Russtopia wrote:
Just looking at the |edif.cc| source quickly, I didn't find any sleep() or usleep() calls, or select()-like calls to wait on editor file handle; could there be a busy loop somewhere awaiting the editor to return or its file to be closed that might be taking up the CPU?
I didn't really study the logic properly though, so my apologies if this is a red herring.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ChrisMoller/edif/issues/3#issuecomment-980511481, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM56AJDLVNYTHMVUIUD3Y3UOB3J7ANCNFSM5I32ZFWA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Ah.. I am not too familiar with inotify() myself. Sure, I am willing to be a guinea-pig for your other tool!
When within the editor spawned by
edif
to edit a function, the CPU usage seems to spike and stay at max until one saves and exits the edit session.[ enter session, then this is observed in another window via the
top
util]:System Info