I'm trying to write something that lets me: * Create a pool of n threads * Add m number of tasks (functions to execute) * Start all threads and process tasks * Enter an eventloop * When all tasks are done, exit the eventloop
This is what I came up with https://gist.github.com/pyshling/92fa607a8c00b38fb6ab#file-gistfile1-py It works as long as number of tasks (num_tasks) is less than or equal to number number of threads (PARALLEL_PROCESSES) but hangs my program what it is greater, which I fail to understand why. Any ideas? The reason to why I want to enter an eventloop while waiting for threads to finish as opposed to just joining the threads is because I also want to use a QTimer that checks the progress every x seconds and joining is blocking and wouldn't allow that. -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/5a3fcefe-7e6f-497c-a261-6443bfd280b0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
