speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix high CPU usage when the output module unexpectedly stops


From: Gilles Casse
Subject: [PATCH] Fix high CPU usage when the output module unexpectedly stops
Date: Thu, 5 Sep 2013 15:55:32 +0200

Speech-dispatcher can consume most of cpu resources if the output module stops.

For example, this issue can be observed on fedora 19 with speech dispatcher 
0.8, when the user logins from a gdm with screen reader on.
Then, the output modules used by gdm are stopped which is followed by a high 
cpu usage. 

---
 src/server/speaking.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/server/speaking.c b/src/server/speaking.c
index ee8c4d4..e9f745c 100644
--- a/src/server/speaking.c
+++ b/src/server/speaking.c
@@ -98,7 +98,10 @@ void *speak(void *data)
                }
                if (poll_count > 1) {
                        if ((revents = poll_fds[1].revents)) {
-                               if ((revents & POLLIN) || (revents & POLLPRI)) {
+                               if (revents & POLLHUP) {
+                                       FATAL
+                                               ("wait_for_poll: output_module 
disconnected");
+                               } else if ((revents & POLLIN) || (revents & 
POLLPRI)) {
                                        MSG(5,
                                            "wait_for_poll: activity on 
output_module");
                                        /* Check if sb is speaking or they are 
all silent. 
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]