title: Multithreading freezes
body: <p>i have a little problem with the following code:</p>
  
  <pre><code>def getTextFromURL(url):
      req = pycurl.Curl()
      print "URL: "+ str(url)
      req.setopt(pycurl.URL, url)
      req.setopt(pycurl.HTTPHEADER, ["Accept:"])
      req.setopt(pycurl.CONNECTTIMEOUT, 5)
      req.setopt(pycurl.TIMEOUT, 10)
      req.setopt(pycurl.NOSIGNAL, 1)
      resultStream = StringIO.StringIO()
      req.setopt(pycurl.WRITEFUNCTION, resultStream.write)
      try: 
          req.perform()
          text = BeautifulSoup(resultStream.getvalue()).get_text()
          return text
      except BaseException as e:
          print type(e)
          return ''
  
  def addTextToTask(newTask):
      newTask.fullText = getTextFromURL(newTask.url)
      return newTask
  
  
  def createTasks(sources):
      newTasks = []
      for source in sources:
          newTask = models.Task(title = source.title, url = source.url, fullText = None)
          newTasks.append(newTask)
      pool = Pool(4)
      fullTasks = pool.map(addTextToTask, newTasks)
      pool.close()
      pool.join() 
      for fullTask in fullTasks:
          db.session.add(fullTask)
      db.session.commit()
      return True
  </code></pre>
  
  <p>When i call the createTasks()-function it works fine, with less than 100 sources. If i call it with more than 100 sources it starts getting slower and finally freezes. I don't get any error-messages.</p>