Jump to content

waiting on multiple threads

- - - - -

  • Please log in to reply
3 replies to this topic

#1
Flying Dutchman

Flying Dutchman

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 890 posts
  • Location:::1
In my homework project I've been tasked to make something like a file explorer. I'm pretty much done, just doing some fine tuning. I have a search filter that scans the whole HDD and to make this faster I spawn 1 thread for each partition (on Unix I declare each partition a folder in "/"). I don't have much experience with threads, but spawning them in Python is really easy (I'm using a derived class from threading.Thread). Now I need to know when those threads are finished so I can "lock" search button so new threads won't spawn while searching is running.
A conclusion is where you got tired of thinking.
#define class struct    // All is public.

#2
Skippy

Skippy

    Programmer

  • Members
  • PipPipPipPip
  • 146 posts
Very cool, and this is all written in python? Does it have a GUI or is it command line driven?

Interested in participating in community events?
Want to harness your programming skill and turn it into absolute prowess?
Come join our programming events!


#3
Flying Dutchman

Flying Dutchman

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 890 posts
  • Location:::1
Yea, all is written in Python and I've used Qt for GUI part.
A conclusion is where you got tired of thinking.
#define class struct    // All is public.

#4
Skippy

Skippy

    Programmer

  • Members
  • PipPipPipPip
  • 146 posts
Correct me if I'm wrong, but does splitting the search function up into different threads really make it go faster?
If there were multiple processors and each thread was executed in sync on different processors, obviously the answer would be yes.

But if the processor was a single core/ single processor, only one thread is being executed at once, and splitting the program into different threads would only require more overhead for switching threads in the kernel.

Have you tried with and without multiple threads? I'm kinda curious as to which method is faster.

Interested in participating in community events?
Want to harness your programming skill and turn it into absolute prowess?
Come join our programming events!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users