Threading, Queue for a function so it only runs once at a time.

Discussion in 'Python' started by John P., Mar 12, 2010.

  1. John P.

    John P. Guest

    Hi,

    Im programming a simple webcrawler with threading for the fun of it, which
    is inserting the data fetch into a mysql database, but after continuously
    cause my mysql server to produce error during database queries (i assume
    its cause because of the many execution at the same time.) the scipt
    produces errors.

    I figured out i need some kind of queue for the function i use to insert
    into the database, to make sure its only called once at a time.

    I have looked at the Queue module but its for more complicated than my
    current python skills can cope with. :)

    Would somebody please help me out here?

    Thanks.

    --
    John P.
     
    John P., Mar 12, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Randall Parker

    Event that runs once when server site updated?

    Randall Parker, Feb 8, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    312
    Trevor Benedict R
    Feb 8, 2006
  2. Russell Warren

    Is Queue.Queue.queue.clear() thread-safe?

    Russell Warren, Jun 22, 2006, in forum: Python
    Replies:
    4
    Views:
    685
    Russell Warren
    Jun 27, 2006
  3. Hari Sekhon
    Replies:
    11
    Views:
    584
    Eric S. Johansson
    Oct 3, 2006
  4. Tim Williams
    Replies:
    9
    Views:
    290
    Lawrence D'Oliveiro
    Oct 7, 2006
  5. Kris
    Replies:
    0
    Views:
    486
Loading...

Share This Page