OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Parallel Instances in Python

  • Thread starter Thread starter Daniel Jungen
  • Start date Start date
D

Daniel Jungen

Guest
I would like to run a specific function in Python parallelized. Right now the code is like:

  • Run a specific function with input_1 and store the result in result_1.
  • Then run the same function with input_2 and store the result in input_2
  • ...

Since the function is used to do a server request to a server which can handle multiplie requests at the same time there is no need to wait until result_1 is created before starting the function again with input_1.

So is there a way to run this function (e.g.) 50 times at the same time with input_1,...,input_50?

I tried multiprocessing but I'm not happy with that package because it seems to ignore print statements in order to give a status update.
<p>I would like to run a specific function in Python parallelized. Right now the code is like:</p>
<ul>
<li>Run a specific function with input_1 and store the result in result_1.</li>
<li>Then run the same function with input_2 and store the result in input_2</li>
<li>...</li>
</ul>
<p>Since the function is used to do a server request to a server which can handle multiplie requests at the same time there is no need to wait until result_1 is created before starting the function again with input_1.</p>
<p>So is there a way to run this function (e.g.) 50 times at the same time with input_1,...,input_50?</p>
<p>I tried multiprocessing but I'm not happy with that package because it seems to ignore print statements in order to give a status update.</p>
 

Latest posts

M
Replies
0
Views
1
MusicLovingIndianGirl
M
Q
Replies
0
Views
1
quora question
Q
Top