This shows you the differences between two versions of the page.

Link to this comparison view

python:python [2015/04/19 14:05]
dblume [Python]
python:python [2020/05/02 17:06] (current)
dblume [Various Approaches to threaded URL Requests]
Line 250: Line 250:
         fcntl.flock(f, fcntl.LOCK_UN)         fcntl.flock(f, fcntl.LOCK_UN)
 </code> </code>
 +====== Various Approaches to threaded URL Requests ======
 +  * [[https://stackoverflow.com/questions/2632520/what-is-the-fastest-way-to-send-100-000-http-requests-in-python|Use Queue and threading's Thread]]
 +  * [[https://www.shanelynn.ie/using-python-threading-for-multiple-results-queue/|Use threading and store results in a pre-allocated list]]. Then use Queue for lots of URLs.
 +  * [[https://dev.to/rhymes/how-to-make-python-code-concurrent-with-3-lines-of-code-2fpe|Use concurrent.futures' ThreadPoolExecutor and map()]].
 +  * Or, use the doc's [[https://docs.python.org/3/library/concurrent.futures.html#threadpoolexecutor-example|ThreadPoolExecutor Example]].
 +  * And, as mentioned in Parallelism in One Line, [[https://chriskiehl.com/article/parallelism-in-one-line|multiprocessing.dummy's Pool and its own map()]].
 ====== Fibonacci Generator with Itertools ====== ====== Fibonacci Generator with Itertools ======
python/python.1429477535.txt.gz · Last modified: 2015/04/19 14:05 by dblume
Recent changes RSS feed Driven by DokuWiki