Author vstinner
Recipients ebfe, gps, pitrou, vstinner
Date 2009-01-02.14:44:21
SpamBayes Score 6.59523e-06
Marked as misclassified No
Message-id <>
> 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:22vstinnersetrecipients: + vstinner, pitrou, gps, ebfe
2009-01-02 14:44:22vstinnersetmessageid: <>
2009-01-02 14:44:21vstinnerlinkissue4751 messages
2009-01-02 14:44:21vstinnercreate