CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
Data corruption?



Jun 1, 2000, 5:05 PM

Post #1 of 3 (1477 views)
Data corruption? Can't Post

I have written a small counter. However to test the script I have tried to see what hapens if the page gets a vast number of hits. Then the count file is corrupted. I have seen that after several thousands it just got back to some small value.
It is sure that the data is corrupted somehow. Probably due to calls simltaneously to the script. Is there a way to reliably increment the value and write it to the file..
p.s. Locking takes pretty much run time, so i didn't prefer that.


Jun 1, 2000, 8:53 PM

Post #2 of 3 (1477 views)
Re: Data corruption? [In reply to] Can't Post

The solution, oddly enough, is to use locking.


Jun 13, 2000, 2:33 PM

Post #3 of 3 (1477 views)
Re: Data corruption? [In reply to] Can't Post

Well, you might want to determine why you don't prefer the run time of locking.

If it's a question of delaying data that is sent to the user, you might want to spawn a new process to increment the counter.

Unless the counter is getting a lot of hits each second, I can't immaging a quick update would take that long....

Dr. Zed


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives