title: i want to use multiprocessing here instead of kthreads but for some reason it aint working
body: <pre><code>    def subtask():
              model = Model(&quot;model-en&quot;)
              rec = KaldiRecognizer(model, 16000)
  
          # Opens microphone for listening.
              p = pyaudio.PyAudio()
              stream = p.open(format=pyaudio.paInt16, channels=1, rate=16000, input=True, frames_per_buffer=1024)
              stream.start_stream()
          
              while True:
                  data = stream.read(1024)
                  if len(data) == 0:
                      break
                  if rec.AcceptWaveform(data):
                  # result is a string
                      result = rec.Result()
                  # convert it to a json/dictionary
                      result = json.loads(result)
                      text = result['text']
                  
                      print(text)
                      query = text
                  if &quot;alarm&quot; in query:
                      pass
                      
      
                      
                      
                      
                  
          t2 = kthread.KThread(target = subtask, name = &quot;main task&quot;)
      t2.start()
      
      def lol():
          model = Model(&quot;model-en&quot;)#next line
          rec = KaldiRecognizer(model, 16000)#next line
  
          # Opens microphone for listening.
          p = pyaudio.PyAudio()
          stream = p.open(format=pyaudio.paInt16, channels=1, rate=16000, input=True, frames_per_buffer=1024)
      
          stream.start_stream()
          
          while True:
              data = stream.read(1024)
              if len(data) == 0:
                  break
              if rec.AcceptWaveform(data):
                  # result is a string
                  result = rec.Result()
                  # convert it to a json/dictionary
                  result = json.loads(result)
                  text = result['text']
                  
                  print(text)
                  query = text
                  if 1==1:
                      if 1==1:
                          if 1==1:
                              if 1==1:
                                  if 1==1:
                                      
                                      
                                      try:
                                          
                                      
  
                                      
                                      
                                          question = query
                                          # App id obtained by the above steps 
                                          app_id = &quot;api key&quot;#add it  
  
                                          # Instance of wolf ram alpha 
                                          # client class 
                                          client = wolframalpha.Client(app_id) 
  
                                          # Stores the response from 
                                          # wolf ram alpha 
                                          res = client.query(question) 
  
                                          # Includes only text from the response 
                                          answer = next(res.results).text 
  
                                          print(answer)
                                      except:
                                          print(&quot;could not find the answer&quot;)
                                      
                                          
          
          
  
      t3 = kthread.KThread(target = lol, name = &quot;new task&quot;)#next line
      t3.start()
  </code></pre>
  <p>1.so what i am trying to achieve here is run both these codes parallely using multiprocessing module and since there are no args which have to be added i think it makes that trickier
  as you can see i used the kthread module which is a countrfeit version of thread but is killable but when i replace k threade with multiprocessing.process random exceptions occur</p>