Issue33823
Created on 2018-06-10 18:05 by Python++, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| BUG for concurrent.futures(Found by william).py | Python++, 2018-06-10 18:11 | Code for A BUG in concurrent/asyncio | ||
| Messages (6) | |||
|---|---|---|---|
| msg319229 - (view) | Author: Python++ (Python++) | Date: 2018-06-10 18:05 | |
ProcessPoolExecutor cannot specify the number of cores when running the Muti-Sub Event Loops, which results in the resulting statistics of the last code run cannot be promised to be separated. I'm deep hoping some genius can propose a solution and fix these problems. |
|||
| msg319231 - (view) | Author: Yury Selivanov (yselivanov) * ![]() |
Date: 2018-06-10 18:18 | |
> which results in the resulting statistics of the last code run cannot be promised to be separated. I'm sorry but I cannot parse your message and the attached code snippet. Please try to formulate the actual bug/feature request more clearly. |
|||
| msg319277 - (view) | Author: Python++ (Python++) | Date: 2018-06-11 07:09 | |
First Kind of resutl sets: ===================================================== Process-2:<4816> is ProcessExecuting [0] MainThread:<4816> is ThreadExecuting [0] exe_iter:0 sub_iter:0 Run for Wheel and result:0 callback number:1 MainThread:<4816> is ThreadExecuting [1] exe_iter:0 sub_iter:1 Run for Wheel and result:2 callback number:2 Process-1:<4512> is ProcessExecuting [1] MainThread:<4512> is ThreadExecuting [0] exe_iter:1 sub_iter:0 Run for Wheel and result:0 callback number:1 MainThread:<4512> is ThreadExecuting [1] exe_iter:1 sub_iter:1 Run for Wheel and result:2 callback number:2 ====================================================== Program runs with different Threads: Tread ID: 4816 and 4512 callback numbers are 1, 2; 1, 2 ==================================================== Second Kind of resutl sets: ====================================================== Process-1:<7360> is ProcessExecuting [0] MainThread:<7360> is ThreadExecuting [0] exe_iter:0 sub_iter:0 Run for Wheel and result:0 callback number:1 MainThread:<7360> is ThreadExecuting [1] exe_iter:0 sub_iter:1 Run for Wheel and result:2 callback number:2 Process-1:<7360> is ProcessExecuting [1] MainThread:<7360> is ThreadExecuting [0] exe_iter:1 sub_iter:0 Run for Wheel and result:0 callback number:3 MainThread:<7360> is ThreadExecuting [1] exe_iter:1 sub_iter:1 Run for Wheel and result:2 callback number:4 ================================================= Program runs with the same and only Thread: Tread ID: 7360 callback numbers are 1, 2; 3, 4 Based on the above situation, it is impossible to ensure that multiple processes will run the program all the way by employing Process Pool. 2018-06-11 2:18 GMT+08:00 Yury Selivanov <report@bugs.python.org>: > > Yury Selivanov <yselivanov@gmail.com> added the comment: > > > which results in the resulting statistics of the last code run cannot be > promised to be separated. > > I'm sorry but I cannot parse your message and the attached code snippet. > Please try to formulate the actual bug/feature request more clearly. > > ---------- > > _______________________________________ > Python tracker <report@bugs.python.org> > <https://bugs.python.org/issue33823> > _______________________________________ > |
|||
| msg319527 - (view) | Author: Pablo Galindo Salgado (pablogsal) * ![]() |
Date: 2018-06-14 16:01 | |
Python++: Sorry, I still cannot understand exactly what is wrong. Could you please redact a little paragraph explaining (1) what function/functions are you using (and maybe a very short example), (2) what is not working and (3) what do you expect to see instead. Sorry if it feels redundant but it will help is understand better the problem. |
|||
| msg319628 - (view) | Author: Terry J. Reedy (terry.reedy) * ![]() |
Date: 2018-06-15 17:38 | |
Python++, when you respond by email, rather than on the web form, delete the message you are responding to. It is already present on the web page and should not be repeated. I unlinked msg319278 because it uselessly repeats the same message that it responds to. |
|||
| msg320585 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2018-06-27 14:30 | |
The first argument of ProcessPoolExecutor is the maximum number of workers. You can use os.cpu_count() to get the number of CPU cores. https://docs.python.org/dev/library/concurrent.futures.html#concurrent.futures.ProcessPoolExecutor I don't see anything wrong here, I close the issue. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:01 | admin | set | github: 78004 |
| 2018-06-27 14:30:08 | vstinner | set | status: open -> closed nosy:
+ vstinner resolution: not a bug |
| 2018-06-27 14:28:46 | vstinner | set | components:
+ Library (Lib), - asyncio title: A BUG in concurrent/asyncio -> concurrent.futures: cannot specify the number of cores |
| 2018-06-15 17:38:44 | terry.reedy | set | nosy:
+ terry.reedy messages: + msg319628 |
| 2018-06-15 17:35:21 | terry.reedy | set | messages: - msg319278 |
| 2018-06-14 16:01:56 | pablogsal | set | nosy:
+ pablogsal messages: + msg319527 |
| 2018-06-11 07:12:04 | Python++ | set | messages: + msg319278 |
| 2018-06-11 07:09:43 | Python++ | set | messages: + msg319277 |
| 2018-06-10 18:18:08 | yselivanov | set | messages: + msg319231 |
| 2018-06-10 18:11:00 | Python++ | set | files: + BUG for concurrent.futures(Found by william).py |
| 2018-06-10 18:05:17 | Python++ | create | |
