Hacker News new | ask | show | jobs
by lightcatcher 3691 days ago
Write an IRC bot with sockets. The program needs to listen to multiple networks inputs (the connections to different IRC servers) as well as respond to user input (or at least signaling). This is a great playground to try out different models such as thread per connection, your own busy waiting or sleeping event loop, and OS event loops such as poll.

If you want to do more parallelism rather than just concurrency, you could have some inputs make the bot start doing some work (like computing the billionth digit of pi) and queue the work up into a threadpool. If you really want to get into parallel programming, you could write a multiproducer-multiconsumer queue to allow the IO threads to communicate with the pi computing worker pool.

Hope this is a good concrete project! I did the first part (multiple connection IRC bot) a few years and it definitely helped me understand concurrency and network programming.