you may be wondering ifinstead of running multiple processes inside an event loopit might be better to run multiple event loops in different processes the answer is"maybehoweverdepending on the exact problem spacewe are probably better off running independent copies of program with single event loop than to try to coordinate everything with master multiprocessing process we've hit most of the high points of asyncio in this sectionand the has covered many other concurrency primitives concurrency is hard problem to solveand no one solution fits all use cases the most important part of designing concurrent system is deciding which of the available tools is the correct one to use for the problem we have seen advantages and disadvantages of several concurrent systemsand now have some insights into which are the better choices for different types of requirements case study to wrap up this and the booklet' build basic image compression tool it will take black and white images (with bit per pixeleither on or offand attempt to compress it using very basic form of compression known as run-length encoding you may find black and white images bit far-fetched if soyou haven' enjoyed enough hours at 've included some sample black and white bmp images (which are easy to read data into and leave lot of opportunity to improve on file sizewith the example code for this we'll be compressing the images using simple technique called run-length encoding this technique basically takes sequence of bits and replaces any strings of repeated bits with the number of bits that are repeated for examplethe string might be replaced with to indicate that zeros are followed by ones and then more zeroes to make things little more interestingwe will break each row into bit chunks didn' pick bits arbitrarily different values can be encoded into bitswhich means that if row contains all ones or all zeroswe can store it in single bytethe first bit indicating whether it is row of or row of sand the remaining bits indicating how many of that bit exists breaking up the image into blocks has another advantagewe can process individual blocks in parallel without them depending on each other howeverthere' major disadvantage as wellif run has just few ones or zeros in itthen it will take up more space in the compressed file when we break up long runs into blockswe may end up creating more of these small runs and bloat the size of the file