title: How to set an multiple alarm in python
body: <p>I want to set multiple alarm in python. What is the recommended way of setting it up? My use-case is that I've threshold time for <code>N</code> variables. When the current time reaches the threshold value, I want all the variables with that threshold values. </p>
  
  <p>Here's my apprach:-</p>
  
  <pre><code>threshold_time_list = [get list all times from the DB]    
  
  current_time = datetime.now()
  
  [i for i in threshold_time_list if i==current_time]
  </code></pre>
  
  <p>But this is very inefficient way of doing it since I might have 250+ variables like <code>a/b/c</code>.
  And also I have to check this condition every second(cronjob). Is there a better way of doing it?</p>
  
  <p>I found on SO, this can be done using threading and making the thread to go to sleep for <code>threshod - current_time</code>. But running 250 threads parallely is again an issue, since I've been facing an issue in my production where Django gets hanged (dont know why) and I need to  restart the server to make it work again. We're asssuming that Django might get out of threads for processing, hence making 250 more threads is cumbersome. </p>
  
  <p>Also if someone knows , why does Django gets hang in b/w the running live product it will be beneficial.</p>
  
  <p>Can this alarm question be done in celery?</p>