2

I am looking for a scheduler in python that will start a series of threads at the same time(exactly 8 of them), and when one of them completes it will add a new one to the job pool, and start it. This process will continue till all the threads (~100) are completed.

I have looked at the APScheduler package. Maybe by using add_job, I might be able to do it, though it is not clear since I could not find any example.

add_job(trigger, func, args, kwargs, jobstore='default', **options)

Does anyone know how to set a trigger in this function

adam
  • 655
  • 1
  • 10
  • 31
  • Himm, I am guessing I will need to use sthg like http://code.activestate.com/recipes/577187-python-thread-pool/ or http://chrisarndt.de/projects/threadpool/threadpool.py.html – adam Oct 30 '12 at 04:45
  • I am not aware of the APScheduler package, but the inbuilt multiprocessing module has a thread pool class which can help achieve what you are doing without writing it from scratch. See the following: http://stackoverflow.com/a/3386632/1537330 – Siddharth Toshniwal Oct 30 '12 at 08:32

1 Answers1

2

The answer to this question is to use the concurrent futures

http://docs.python.org/dev/library/concurrent.futures.html

adam
  • 655
  • 1
  • 10
  • 31