|
22 | 22 | "from fastcore.xtras import *\n", |
23 | 23 | "from functools import wraps\n", |
24 | 24 | "\n", |
25 | | - "# from contextlib import contextmanager,ExitStack\n", |
26 | 25 | "from multiprocessing import Process, Queue\n", |
27 | 26 | "import concurrent.futures,time\n", |
28 | 27 | "from multiprocessing import Manager, set_start_method\n", |
29 | 28 | "from threading import Thread\n", |
30 | | - "\n", |
31 | 29 | "try:\n", |
32 | | - " if sys.platform == 'darwin': set_start_method(\"fork\")\n", |
| 30 | + " if sys.platform == 'darwin' and IN_NOTEBOOK: set_start_method(\"fork\")\n", |
33 | 31 | "except: pass" |
34 | 32 | ] |
35 | 33 | }, |
|
237 | 235 | "text/markdown": [ |
238 | 236 | "<h4 id=\"ThreadPoolExecutor\" class=\"doc_header\"><code>class</code> <code>ThreadPoolExecutor</code><a href=\"\" class=\"source_link\" style=\"float:right\">[source]</a></h4>\n", |
239 | 237 | "\n", |
240 | | - "> <code>ThreadPoolExecutor</code>(**`max_workers`**=*`64`*, **`on_exc`**=*`print`*, **`pause`**=*`0`*, **\\*\\*`kwargs`**) :: [`ThreadPoolExecutor`](/parallel.html#ThreadPoolExecutor)\n", |
| 238 | + "> <code>ThreadPoolExecutor</code>(**`max_workers`**=*`4`*, **`on_exc`**=*`print`*, **`pause`**=*`0`*, **\\*\\*`kwargs`**) :: [`ThreadPoolExecutor`](/parallel.html#ThreadPoolExecutor)\n", |
241 | 239 | "\n", |
242 | 240 | "Same as Python's ThreadPoolExecutor, except can pass `max_workers==0` for serial execution" |
243 | 241 | ], |
|
292 | 290 | "text/markdown": [ |
293 | 291 | "<h4 id=\"ProcessPoolExecutor\" class=\"doc_header\"><code>class</code> <code>ProcessPoolExecutor</code><a href=\"\" class=\"source_link\" style=\"float:right\">[source]</a></h4>\n", |
294 | 292 | "\n", |
295 | | - "> <code>ProcessPoolExecutor</code>(**`max_workers`**=*`64`*, **`on_exc`**=*`print`*, **`pause`**=*`0`*, **\\*\\*`kwargs`**) :: [`ProcessPoolExecutor`](/parallel.html#ProcessPoolExecutor)\n", |
| 293 | + "> <code>ProcessPoolExecutor</code>(**`max_workers`**=*`4`*, **`on_exc`**=*`print`*, **`pause`**=*`0`*, **\\*\\*`kwargs`**) :: [`ProcessPoolExecutor`](/parallel.html#ProcessPoolExecutor)\n", |
296 | 294 | "\n", |
297 | 295 | "Same as Python's ProcessPoolExecutor, except can pass `max_workers==0` for serial execution" |
298 | 296 | ], |
|
383 | 381 | "name": "stdout", |
384 | 382 | "output_type": "stream", |
385 | 383 | "text": [ |
386 | | - "0 2022-04-03 01:25:58.938402\n", |
387 | | - "1 2022-04-03 01:25:59.189256\n", |
388 | | - "2 2022-04-03 01:25:59.439853\n", |
389 | | - "3 2022-04-03 01:25:59.691909\n", |
390 | | - "4 2022-04-03 01:25:59.943055\n" |
| 384 | + "0 2022-06-30 09:28:21.811632\n", |
| 385 | + "1 2022-06-30 09:28:22.062815\n", |
| 386 | + "2 2022-06-30 09:28:22.314447\n", |
| 387 | + "3 2022-06-30 09:28:22.565210\n", |
| 388 | + "4 2022-06-30 09:28:22.816731\n" |
391 | 389 | ] |
392 | 390 | } |
393 | 391 | ], |
|
0 commit comments