how to enable use of threads in gunicorn

Oha*_*rry 9 python multithreading gunicorn

This is my worker script code worker.py:

def app():
   # do some stuff
   threads = [] 
   t = threading.Thread(target = some_method, args = (1,2))
   threads += [t]
        t.start()

    for t in threads:
        t.join()
Run Code Online (Sandbox Code Playgroud)

if I run it like so :

 phython worker.py
Run Code Online (Sandbox Code Playgroud)

it works. But if I run it like so : gunicorn -c gunicorn_config.py worker:app

It's stuck in the threads section. The threads are downloading images so I rather do in parallel.

my config is like so :

worker_class = 'sync'
worker_connections = 1000
timeout = 360
keepalive = 2
#This is  the nuclear option. will print everything to log
spew = False
daemon = False
pidfile = 'master.pid'
umask = 0
user = None
group = None
tmp_upload_dir = None
logfile = 'log_tmp.log'
errorlog = '-'
loglevel = 'info'
accesslog = '-'
proc_name = 'GenericGunicorn'
# 0 is unlimited
limit_request_line = 0
Run Code Online (Sandbox Code Playgroud)

my questions are:

  1. how can i solve that? make the threads work?
  2. if I can't, why should I use to run multiple worker processes on one machine ?