Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Threading, Queue for a function so it only runs once at a time.

Reply
Thread Tools

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

 
 
John P.
Guest
Posts: n/a
 
      03-12-2010
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Program blocked in Queue.Queue.get and Queue.Queue.put Kris Python 0 01-04-2012 03:46 PM
Re: Making sure script only runs once instance at a time. Tim Williams Python 9 10-07-2006 10:01 PM
Making sure script only runs once instance at a time. Hari Sekhon Python 11 10-03-2006 01:50 PM
Is Queue.Queue.queue.clear() thread-safe? Russell Warren Python 4 06-27-2006 03:03 PM
Event that runs once when server site updated? Randall Parker ASP .Net 2 02-08-2006 02:52 AM



Advertisments