diff --git a/README.md b/README.md index 1383938..421bd22 100644 --- a/README.md +++ b/README.md @@ -2043,12 +2043,13 @@ with lock: ### Thread Pool Executor ```python from concurrent.futures import ThreadPoolExecutor -with ThreadPoolExecutor(max_workers=None) as executor: +with ThreadPoolExecutor(max_workers=None) as executor: # None == `n_cores * 5`. = executor.map(lambda x: x + 1, range(3)) # (1, 2, 3) = executor.map(lambda x, y: x + y, 'abc', '123') # ('a1', 'b2', 'c3') = executor.submit( [, , ...]) ``` +#### Future ```python = .done() # Checks if thread has finished executing. = .result() # Waits for thread to finish and returns result. diff --git a/index.html b/index.html index 44551c1..412347e 100644 --- a/index.html +++ b/index.html @@ -1799,15 +1799,16 @@ lock.release()

Thread Pool Executor

from concurrent.futures import ThreadPoolExecutor
-with ThreadPoolExecutor(max_workers=None) as executor:
+with ThreadPoolExecutor(max_workers=None) as executor:         # None == `n_cores * 5`.
     <iter>   = executor.map(lambda x: x + 1, range(3))         # (1, 2, 3)
     <iter>   = executor.map(lambda x, y: x + y, 'abc', '123')  # ('a1', 'b2', 'c3')
     <Future> = executor.submit(<function> [, <arg_1>, ...])
 
-
<bool> = <Future>.done()             # Checks if thread has finished executing.
+

Future

<bool> = <Future>.done()             # Checks if thread has finished executing.
 <obj>  = <Future>.result()           # Waits for thread to finish and returns result.
-
+
+

Queue

A thread-safe FIFO queue. For LIFO queue use LifoQueue.

from queue import Queue
 <Queue> = Queue(maxsize=0)