summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-05-19 15:05:55 -0700
committerAdam Jackson <ajax@redhat.com>2016-07-18 15:27:51 -0400
commit7762a602c1dfdd8cfcf2b8c2281cf4d683d05216 (patch)
treefcf8b465241641e5c42ad90cc1f98842e8c39af6 /os
parent4af00242ef1e39499b932d12423fdf449296090a (diff)
dix/os: Merge priority computation into SmartScheduleClient
Instead of having scheduling done in two places (one in WaitForSomething, and the other in SmartScheduleClient), just stick all of the scheduling in SmartScheduleClient. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'os')
-rw-r--r--os/WaitFor.c33
1 files changed, 2 insertions, 31 deletions
diff --git a/os/WaitFor.c b/os/WaitFor.c
index 350f61522..b6801fea9 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -326,17 +326,14 @@ WaitForSomething(int *pClientsReady)
if (XFD_ANYSET(&clientsReadable)) {
#ifndef WIN32
for (i = 0; i < howmany(XFD_SETSIZE, NFDBITS); i++) {
- int highest_priority = 0;
-
while (clientsReadable.fds_bits[i]) {
- int client_priority, client_index;
+ int client_index;
curclient = mffs(clientsReadable.fds_bits[i]) - 1;
client_index = /* raphael: modified */
ConnectionTranslation[curclient +
(i * (sizeof(fd_mask) * 8))];
#else
- int highest_priority = 0;
fd_set savedClientsReadable;
XFD_COPYSET(&clientsReadable, &savedClientsReadable);
@@ -346,33 +343,7 @@ WaitForSomething(int *pClientsReady)
curclient = XFD_FD(&savedClientsReadable, i);
client_index = GetConnectionTranslation(curclient);
#endif
- /* We implement "strict" priorities.
- * Only the highest priority client is returned to
- * dix. If multiple clients at the same priority are
- * ready, they are all returned. This means that an
- * aggressive client could take over the server.
- * This was not considered a big problem because
- * aggressive clients can hose the server in so many
- * other ways :)
- */
- client_priority = clients[client_index]->priority;
- if (nready == 0 || client_priority > highest_priority) {
- /* Either we found the first client, or we found
- * a client whose priority is greater than all others
- * that have been found so far. Either way, we want
- * to initialize the list of clients to contain just
- * this client.
- */
- pClientsReady[0] = client_index;
- highest_priority = client_priority;
- nready = 1;
- }
- /* the following if makes sure that multiple same-priority
- * clients get batched together
- */
- else if (client_priority == highest_priority) {
- pClientsReady[nready++] = client_index;
- }
+ pClientsReady[nready++] = client_index;
#ifndef WIN32
clientsReadable.fds_bits[i] &= ~(((fd_mask) 1L) << curclient);
}