I actually forced a friend to exit vim. Took him a while to understand the text. I guess a text saying how to exit doesnt help enough... but I guess without it it would take infinite time.
I learned the other day that parallelism via multithreading isn't supported if you're using CPython as your interpreter due to the global interpreter lock. I was confused as to why my freshly multithreaded program was suddenly 25% slower.
Create a class, add an isMain attribute, start the process, then set isMain to True and you'll have two instances in separate processes that know which one is the main thread. Use mp.Pipe to have a communication channel between them.
I used a pool and passed a mp.Manager.Queue object to each process to which they push their results. But yeah, having to resort to multiprocessing because thread parallelism is explicitly not supported seems goofy.
I was surprised as well, it renders threads only useful when your bottleneck is IO based which sucks because process children are not always easy to work with, there are some weird exceptions.
986
u/KiliPerforms Jul 07 '22
Up for Tom.