Python Forum
5 threading methods, none sped up the program
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
5 threading methods, none sped up the program
#6
Something like this. It is very late and I am very tired so you will have to correct any typos or other errors

def use_mult_process():
        from multiprocessing import Process

        ## byu_dir has not been declares
        files_list=os.listdir(os.path.join(str3, "010/"))
        process_list=[]
        for f in file_list:
            full_path=os.path.join(str3, "010/", f)
            if os.path.isfile(full_path):  ## not a dir
                ## send one file only to the function, and
                ## it is a file and not a dir
                q = Process(target=build_dict_json, args=(full_path,))
                q.start()
                process_list.append(q)

        for q in process_list:
            q.join()
Reply


Messages In This Thread
RE: 5 threading methods, none sped up the program - by woooee - Sep-25-2018, 04:46 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Concurrent futures threading running at same speed as non-threading billykid999 13 1,865 May-03-2023, 08:22 AM
Last Post: billykid999
  Tutorials on sockets, threading and multi-threading? muzikman 2 2,130 Oct-01-2021, 08:32 PM
Last Post: muzikman

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020