I'm trying to understand why my CPU pegs to 100% when I use a FIFO in conjunction with g_io_channel.
I have a project on github that demonstrates the problem with the smallest possible setup; just a simple server that opens a FIFO in /tmp, and a client that sends a message to the server via that FIFO.
I found:
- When first started, the server takes close to zero CPU
- As soon as the client sends a message to the server via the FIFO, the message is received and printed by the server, and then the CPU goes to 100%.
- You can continue to send messages via the FIFO and the server will print them, but that CPU stays at 100% :-/
I've tried the usual google, and stack overflow, but so far no joy on finding a solution. I hope someone can help me understand what's going on. I believe I am using glib/GTK correctly, but I'm quite happy to stand corrected. I appreciate any help you can provide. Thanks!