MakerGram Logo

    MakerGram

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

    jerinisready

    @jerinisready

    1
    Reputation
    20
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    jerinisready Unfollow Follow

    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

    Latest 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
    • RE: Multi Thread Handling for normal Processes using python

      I suggest you multiprocessing to handle dlifferent processes.
      Use multiprocessing.Process.
      If you want to establish a communication between parent and child process, use multiprocessing.Queue or multiprocessing.Pipe

      posted in Raspberry Pi
      J
      jerinisready