Questions tagged [apply-async]

20 questions
0
votes
1 answer

Python program not throwing error when called with wrong parameters in apply_async

Hello this is a sample example of something that I want to do. I want to use threads in my application. It's working fine the issues is python is not throwing error when I by mistake call function with wrong parameter making it sometimes harder to…
fist ace
  • 41
  • 1
  • 6
0
votes
0 answers

Code never enters 'with Pool(processes=4) as pool: block

New to multiprocessing in python and just trying to understand why my code won't go inside the 'with Pool(processes=4) as pool: block. Here is a simple code (I removed some details because they are not necessary). import os import psutil import…
0
votes
2 answers

Parallel processing for testing ML model with pool.apply_async does not allow access to results

I have a dataset of 2.7 million samples that I need to test my ML model on. I have 8 cores on my laptop and want to try parallelizing my testing code to save time. This is the test function : def testMTGP(x_sample, y_sample, ind, model,…
ak_nama
  • 103
  • 3
0
votes
1 answer

generating a list of arrays using multiprocessing in python

I am having difficulty implementing parallelisation for generating a list of arrays. In this case, each array is generated independently, and then appended to a list. Somehow multiprocessing.apply_asynch() is outputting an empty array when I feed it…
0
votes
0 answers

Why does my python function treat a string argument as list/array when using Pool apply_async?

I'm encountering some strange behavior in my python program. I'm using a Pool to run some functions in parallel and using the apply_async function. The strange behavior is that, apparently, significantly more arguments are being passed to the…
fireshadow52
  • 6,298
  • 2
  • 30
  • 46
1
2