I am searching for a sensible (i.e. it should really be useful in terms of efficiency) example using python threads & locks. I know many standard small examples but they are all missing at least one of the properties "small", "sensible" or "using locks" -- for example:
- Testing a list of URLs to check availability (sensible, small, but uses no locks)
- Implementing a few clients (one per thread) and a server holding a variable (or bank account or something alike) -- small, uses locks, but not sensible (in practice there are better ways to implement this).
- Parallelzing a simple algorithm via threads (like the summation of a large list) -- small, but both not sensible (cause you wouldnt parallelize via threads) and not using locks.