Current location: Hot Scripts Forums » Programming Languages » PHP » Concurrent Access Text/CSV file


Concurrent Access Text/CSV file

Reply
  #1 (permalink)  
Old 10-17-06, 01:19 AM
weilies weilies is offline
Newbie Coder
 
Join Date: Apr 2004
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Concurrent Access Text/CSV file

hi, i hv a situation here,

let say 1 visitor need to add one line of record into the script before it proceed to the next line of code, but wht if 100 visitor access con-currently, then wht will happen?

question
1. will the other visitor going to wait for the one to write to the text/csv file before they can proceed?
2. will some of the records going to mis-insert into the file?
3. What if i want all of their record 100 lines to be inserted nicely, wht is the better approch?


Thanks
Reply With Quote
  #2 (permalink)  
Old 10-17-06, 04:52 AM
duesi's Avatar
duesi duesi is offline
Wannabe Coder
 
Join Date: Jun 2006
Posts: 225
Thanks: 0
Thanked 0 Times in 0 Posts
Your problem is the reason why there are databases. If you write to a file, this causes a lock, which means that nobody else can write to the file until you are done. In toher words: there can be a lot of people waiting.
A Database manages exactly this situation: it manages the concurrency efficiently (but Mysql is not the best of examples for this kind of stuff, if you need a real DB. look at postgresql or oracle).
__________________
Duesi

"One of the great skills in using any language is knowing what not to use, what not to say" (Ron Jeffries)

http://www.swissbytes.de
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FORM LOGIN (Access .htaccess file in IE) jagis Perl 5 04-05-07 05:44 AM
Checking a file exists lee PHP 3 04-23-06 12:44 AM
open access file from staweel22 The Lounge 2 03-30-06 05:49 PM
Error message not getting displayed. sanjeet Windows .NET Programming 0 12-20-05 10:48 AM
Coverting MS Access database to Text file sandeep_mankoo ASP 0 04-17-04 08:48 AM


All times are GMT -5. The time now is 05:43 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.