1
0
mirror of https://github.com/deavmi/birchwood synced 2024-09-20 07:23:14 +02:00
- Disagnosed hot-loop causing high load average (and wasting run queue time with meaningless work)
- Offending functions are `sendHandlerFunc()` and `recvHandlerFunc()` and NOT eventy (as latest version doesn't do that
This commit is contained in:
Tristan B. Velloza Kildaire 2023-03-08 17:24:41 +02:00
parent 241f7753f5
commit b9b2cb9c2e

View File

@ -807,6 +807,10 @@ public class Client : Thread
* an event depending on the type of message * an event depending on the type of message
* *
* Handles PINGs along with normal messages * Handles PINGs along with normal messages
*
* TODO: Our high load average is from here
* ... it is getting lock a lot and spinning here
* ... we should use libsnooze to avoid this
*/ */
private void recvHandlerFunc() private void recvHandlerFunc()
{ {
@ -880,7 +884,7 @@ public class Client : Thread
// logger.log("Ponged"); // logger.log("Ponged");
/* TODO: Implement */ /* TODO: Implement */
// TODO: Remove the Eventy push and replace with a handler call // TODO: Remove the Eventy push and replace with a handler call (on second thought no)
Event pongEvent = new PongEvent(pingID); Event pongEvent = new PongEvent(pingID);
engine.push(pongEvent); engine.push(pongEvent);
} }
@ -902,7 +906,7 @@ public class Client : Thread
/* TODO: Parse message and call correct handler */ /* TODO: Parse message and call correct handler */
curMsg = Message.parseReceivedMessage(messageNormal); curMsg = Message.parseReceivedMessage(messageNormal);
// TODO: Remove the Eventy push and replace with a handler call // TODO: Remove the Eventy push and replace with a handler call (on second thought no)
Event ircEvent = new IRCEvent(curMsg); Event ircEvent = new IRCEvent(curMsg);
engine.push(ircEvent); engine.push(ircEvent);
} }
@ -919,6 +923,9 @@ public class Client : Thread
/** /**
* The send queue worker function * The send queue worker function
*
* TODO: Same issue as recvHandlerFunc
* ... we should I/O wait (sleep) here
*/ */
private void sendHandlerFunc() private void sendHandlerFunc()
{ {