Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

Is this a read/write race condition?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
antonyliu2002@yahoo.com - 26 Jul 2007 17:01 GMT
I do not quite understand the race condition.

As I posted a couple of days ago, I create a PDF on the fly in my web
application at regular intervals.  Users will be able to download the
PDF file.

Suppose, at the time when my application is in the process of
generating the PDF file (which takes around 2.5 minutes), a user tries
to download it, will this be a problem?

I checked the Lock method of FileStream.  The description of this
method says:

Prevents other processes from changing the FileStream while permitting
read access.

>From the description, read access is permitted even if the stream is
locked.  So, it looks like the creation of the PDF file and the
downloading of this file can happen at the same time without a
problem, right?

Thanks.
Lloyd Sheen - 26 Jul 2007 18:19 GMT
>I do not quite understand the race condition.
>
[quoted text clipped - 18 lines]
>
> Thanks.

Perhaps you could do one of the following:

1.  Create the PDF with a different name than the name which users will
download.  Once the PDF is created then delete the old one and change the
name of the new one to the download name.

2.  Disable the mechanism (button ??) to download the file while a new on is
being created.

Hope this helps,

Lloyd Sheen
antonyliu2002@yahoo.com - 26 Jul 2007 19:10 GMT
> <antonyliu2...@yahoo.com> wrote in message
>
[quoted text clipped - 35 lines]
>
> Lloyd Sheen

Hi, Lloyd,

Thanks.  your idea 1 is absolutely a good solution, since changing the
file name is only a flash of second in an application.  That will
certainly reduce the probability of race condition otherwise imposed
in a 2.5-minute duration when the PDF file is being created.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.