Perl - recursive looping and resource use

They have: 2 posts

Joined: Mar 2006

I'm developing a system where threads update a database table of URLs, post data, and match string text. I think it's impractical for each thread to open the socket and process its data before sending the waiting client its reply, so the idea is to use a persistent background process to check the table every half minute or so and serve the requests independent of the client's timeout.

Could anyone give me some information on the program structure I would use to make this possible with Perl or PHP?

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

You'll have to explain in some more detail, I'm afraid. It's not clear to me what the situation or, more importantly, problem is.

It sounds like something that might be helped by persistent connections to the database. See mysql_pconnect for PHP and Apache::DBI for Perl.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.