MakerGram Logo

    MakerGram

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    1. Home
    2. jerinisready
    3. Best
    J
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 2
    • Best 1
    • Controversial 0
    • Groups 0

    Best posts made by jerinisready

    • RE: Multi Thread Handling for normal Processes using python

      @kowshik1729
      that's builtin at python. only thing is. you can simply import using

      from multiprocessing import Process
      def my_function_to_run(*args, **kwargs):
           ...
           ...
      
      def main():
          p1 = Process(
                         target=my_function_to_run, 
                         args=('arg_01', 'arg_02', 'arg_03', ), 
                         kwargs={'key': 'value', 'another_key':True}
          )
          p1.start()
          p2 = Process(
                         target=my_function_to_run, 
                         args=('arg_01', 'arg_02', 'arg_03', ), 
                         kwargs={'key': 'value', 'another_key':True}       
          )
          p2.start()
          
          p1.join()
          p2.join()
          print("Finished!")
      
      if __name__ == '__main__':
         main()
      

      This Might can help: https://docs.python.org/2/library/multiprocessing.html

      posted in Raspberry Pi
      J
      jerinisready