Linked Questions

4 votes
2 answers
16k views

I need to execute 3 functions in parallel and retrieve a value from each of them. Here my code: def func1(): ... return x def func2(): ... return y def func3(): ... return z ...
Fab's user avatar
  • 1,235
2 votes
1 answer
12k views

I'd like to create a multi-threaded version of a function. I discover t.start() returns None, so I have to use queue. I searched the documentation, but I don't understand how to use it in my example. ...
Matteo's user avatar
  • 59
1 vote
1 answer
7k views

I have written a code which sums the elements of array and prints it using multithreading. But instead of using a global value I want to use a local one and return it. However as i use return the ...
Raghuvardhan Karanam's user avatar
0 votes
2 answers
849 views

I have written this sample code that generate random numbers using multiple threads. I can print each random number without any problems. But what I am trying to achieve is, I want to collect all the ...
nipunasudha's user avatar
  • 2,637
4 votes
1 answer
837 views

I have written a Python function that uses multithreading. def image(link_ID): tid1 = Thread(target=displayImage, args=(link_ID,)) tid2 = Thread(target=publishIAmFree) tid1.start() ...
Adam_zampa's user avatar
1 vote
1 answer
1k views

How can I append the thread to the response list? import requests import threading def URLOK(url): page = requests.get(url, proxies=proxies) return url + ":"+ str(page.status_code)+"\n" ...
Tronald Dump's user avatar
  • 1,360
2 votes
2 answers
757 views

I'm having trouble extracting return values from a subroutine I ran from within a thread, in python 3. import threading from threading import Thread def dothis(): x = 17 return x Thread(...
Aliflo's user avatar
  • 73
2 votes
0 answers
194 views

I am in search of a way to threading with wrapper, yet, the result of wrapped function MUST be still available. Via searching Stackoverflow, a not so perfect solution appreared. As the code below: ...
Elias's user avatar
  • 59
0 votes
1 answer
155 views

I am currently writing a program that is required to be as fast as possible. Currently, one of the functions looks like this: def function(): value = get_value() # Multiple lines of code ...
wtreston's user avatar
  • 1,061
-1 votes
1 answer
131 views

I have used python to make a program that can get the name of similar Movies. I have used threading to make sure that the functions run parallel to prevent time wastage. import threading import ...
Major Optimization of Authenti's user avatar
0 votes
0 answers
133 views

I tried the following but it is for multiprocess not threading Python threading return values how to get the return value from a thread in python? is a similar question but the answer also uses ...
O.rka's user avatar
  • 31k
0 votes
0 answers
47 views

I have the following code. What i am trying to do is to run many instances of function. In this case for example, the function bigbangtheory() would return df. Could you please advise how can i save ...
Slartibartfast's user avatar
0 votes
0 answers
19 views

I am trying to save an output of multiple threading to the variable Output_1 and Output_2. My code is as follows. import multiprocessing from threading import Thread from multiprocessing import Pool ...
CanaryTheBird's user avatar
151 votes
11 answers
86k views

Would it be possible to create a python Pool that is non-daemonic? I want a pool to be able to call a function that has another pool inside. I want this because deamon processes cannot create process....
Max's user avatar
  • 8,846
72 votes
14 answers
112k views

How do I get a thread to return a tuple or any value of my choice back to the parent in Python?
pjay's user avatar
  • 2,482

15 30 50 per page
1
2 3 4 5
7