Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
lcc-reese84
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangmingming
lcc-reese84
Commits
54471006
Commit
54471006
authored
Oct 24, 2023
by
wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
1a4197c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
21 deletions
+20
-21
main.py
src/main.py
+20
-21
No files found.
src/main.py
View file @
54471006
...
...
@@ -77,28 +77,27 @@ def exec(thread_id):
def
run
():
brush_thread
=
2
while
True
:
print
(
f
'本次并发数 {brush_thread}'
)
# pool = ThreadPoolExecutor(max_workers=brush_thread)
# all_task = [pool.submit(exec, (i)) for i in range(brush_group)]
# brush_check = CONFIG['internal']['reverse']['making']['brush_check']
# wait(all_task, return_when=ALL_COMPLETED)
# print(f'休息 {brush_check} 秒')
# time.sleep(brush_check)
with
ThreadPoolExecutor
(
max_workers
=
brush_thread
)
as
executor
:
objs
=
[]
for
t
in
range
(
1
,
brush_thread
+
1
):
task
=
executor
.
submit
(
exec
,
t
)
objs
.
append
(
task
)
while
1
:
time
.
sleep
(
1
)
for
n
,
o
in
enumerate
(
objs
):
if
o
.
done
():
task
=
executor
.
submit
(
exec
,
n
+
1
)
objs
[
n
]
=
task
print
(
f
'本次并发数 {brush_thread}'
)
# pool = ThreadPoolExecutor(max_workers=brush_thread)
# all_task = [pool.submit(exec, (i)) for i in range(brush_group)]
# brush_check = CONFIG['internal']['reverse']['making']['brush_check']
# wait(all_task, return_when=ALL_COMPLETED)
# print(f'休息 {brush_check} 秒')
# time.sleep(brush_check)
with
ThreadPoolExecutor
(
max_workers
=
brush_thread
)
as
executor
:
objs
=
[]
for
t
in
range
(
1
,
brush_thread
+
1
):
task
=
executor
.
submit
(
exec
,
t
)
objs
.
append
(
task
)
while
1
:
time
.
sleep
(
1
)
for
n
,
o
in
enumerate
(
objs
):
if
o
.
done
():
task
=
executor
.
submit
(
exec
,
n
+
1
)
objs
[
n
]
=
task
if
__name__
==
'__main__'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment