Hello friends. Today we'll face with new programming pattern. This is decorator. It is wrapper around your function. Frankly speaking, there are a lot of infromation about decorators in python and I'll not explain how it works. Please find great explanation of decorators in useful links. There are two links, one to stackoverflow and second one is habrahabr russian variant.
I thought that it would be nice if I'll create some nice decorator from real life. So... let's create files, let's say with 200 Mb size, in three different file system (ext4, ext4 without journaling and btrfs) and check time of execution of file creation process. I'll do it on my Vbo...
Inspired by Alex's time decorator, I decided to use it for better understanding threads and GIL restrictions.
I read that
Python threads are good for concurrent I/O programming. Threads are swapped out of the CPU as soon as they block waiting for input from file, network, etc. This allows other Python threads to use the CPU while others wait. This would allow you to write a multi-threaded web server or web crawler, for example.
However, Python threads are serialized by the GIL when they enter interpreter core. (source)
So here is my little research below.
1. Reading large files.
As I understood, Python threads work good when they don't compete for CPU. I've c...