Message78801
> Releasing the GIL is somewhat expensive and should be avoided
> if possible.
Another possible solution is to create a lockless object by default,
and create a lock if the data size is bigger than N (eg. 8 KB). When
the lock is created, update will always use the lock (and so the GIL).
In general, you have two classes of hashlib usages:
- hash a big files by chunk of k KB (eg. 256 KB)
- hash a very small string (eg. 8 bytes)
When you have a small string, you don't need to release the GIL nor to
use locks. Whereas for a file, you can always release the GIL (and so
you need a lock to protect the context). |
|
| Date |
User |
Action |
Args |
| 2009-01-02 14:44:22 | vstinner | set | recipients:
+ vstinner, pitrou, gps, ebfe |
| 2009-01-02 14:44:22 | vstinner | set | messageid: <[email protected]> |
| 2009-01-02 14:44:21 | vstinner | link | issue4751 messages |
| 2009-01-02 14:44:21 | vstinner | create | |
|