jurassicplayer / NekoLoliBot

0 stars 0 forks source link

Migrate from GIL to slight Multiprocessing #12

Open jurassicplayer opened 9 years ago

jurassicplayer commented 9 years ago

Some IRC bot implementation somewhere utilized parallel processing to divvy out new lines in IRC to separate processes so the bot wouldn't hang on a single particular user's commands. Supposedly would improve performance of the bot during high traffic times.

-Copy the idea in a shoddy/hack-y implementation.

jurassicplayer commented 8 years ago

Threading too hard for my pleb self. I made two kinds of daemon threads (so they die with the bot on close). Unfortunately, this really doesn't exactly provide much profit in terms of threading (in my mind's eye anyways, dunno about actual performance), since really it isn't threading the main issue I wanted to deal with.

The first kind is spawned per IRC server (one thread per server) that receives data from the server and dumps the server handle and message handle into the all encompassing "recv_queue".

The other is a singular thread that processes EVERYTHING from all of the servers and distributes them to the plugins.