[Rpm-maint] [rpm-software-management/rpm] Adding an event loop in RPM to run asynchronous operations. (#258)
Jeff Johnson
notifications at github.com
Mon Aug 7 00:48:15 UTC 2017
The libeio event loop adds RPM_CHECK_LIB to handle --with-libeio here:
[https://github.com/rpm5/rpm/commit/133c60b4036fd97af89390aea6ae94034239d545](url)
(Presumably you will do your own pkg-config AutoFU to handle --with-libeio)
The patch in comments above has been mildly reworked to remove all debugging and start the event loop globally here:
[https://github.com/rpm5/rpm/commit/f29874c11d30309048bc726f637c1cc5e2c6b856](url)
You will need to manually enable asynchronous fsync-on-close (similar as before):
```
diff --git a/lib/fsm.c b/lib/fsm.c
index 553774b..a7affcf 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -218,7 +218,7 @@ static int expandRegular(rpmfi fi, const char *dest, rpmpsm psm, int nodigest, i
/* Create the file with 0200 permissions (write by owner). */
{
mode_t old_umask = umask(0577);
- wfd = Fopen(dest, "w.ufdio");
+ wfd = Fopen(dest, "wNS.ufdio");
umask(old_umask);
}
if (Ferror(wfd)) {
```
What is likely controversial is starting the event loop everywhere all the time in lib/poptALL.c
```
+#if defined(WITH_LIBEIO)
+ /* Start libeio event loop. */
+ rc = rpmeioStart(NULL);
+ if (rc)
+ fprintf(stderr, _("%s: event loop failed to start (%d)\n"),
+ xgetprogname(), rc);
+#endif
```
If you don't like my patch in lib/poptALL.c (I have mixed feelings), then please supply a positive suggestion for where and how to start an event loop in RPM.
I doubt an idle event loop hurts anything. But if an idle event loop does affect RPM somehow, well its time to discover what else is needed IMHO. YMMV ...
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/258#issuecomment-320544133
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20170807/81773f30/attachment-0001.html>
More information about the Rpm-maint
mailing list