DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Mon, 23 Jul 2007 00:51:45 -0700,    posted on: microsoft.public.dotnet.framework.aspnet.webservices        back       

Thread Index
  1    nano2k
          2    Luis Ruiz Pavón
          3    nano2k


Application.Lock()/UnLock() or lock(Application)   
Hello

Is there a difference between:

1.
Application.Lock();
try {
  //...code
}
finally {
  Application.UnLock();
}

pattern and
2.
lock(Application) {
  //...code
}

?

I read on MSDN (http://support.microsoft.com/default.aspx/kb/271787)
that there are some situations when the first pattern blocks the
service.

Thanks.
Date:Mon, 23 Jul 2007 00:51:45 -0700   Author:  

RE: Application.Lock()/UnLock() or lock(Application)   
Hi:

The first pattern is only applied to application state in web applications 
while second pattern is a rapid and easily implementation of Monitor (enter() 
and exit()) class valid for many situations.

Sorry for my english!!!

Regards

-- 
Colabora con el foro: Si la respuesta te es de utilidad marca la pregunta 
como respondida.
Luis Ruiz Pavón
MCP - MCTS
Blog: http://geeks.ms/blogs/lruiz



"nano2k" wrote:


> Hello
> 
> Is there a difference between:
> 
> 1.
> Application.Lock();
> try {
>   //...code
> }
> finally {
>   Application.UnLock();
> }
> 
> pattern and
> 2.
> lock(Application) {
>   //...code
> }
> 
> ?
> 
> I read on MSDN (http://support.microsoft.com/default.aspx/kb/271787)
> that there are some situations when the first pattern blocks the
> service.
> 
> Thanks.
> 
> 
Date:Tue, 24 Jul 2007 04:28:03 -0700   Author:  

Re: Application.Lock()/UnLock() or lock(Application)   
On 24 Iul, 14:28, Luis Ruiz Pavón  wrote:

> Hi:
>
> The first pattern is only applied to application state in web applications
> while second pattern is a rapid and easily implementation of Monitor (enter()
> and exit()) class valid for many situations.
>
> Sorry for my english!!!
>
> Regards
>
> --
> Colabora con el foro: Si la respuesta te es de utilidad marca la pregunta
> como respondida.
> Luis Ruiz Pavón
> MCP - MCTS
> Blog:http://geeks.ms/blogs/lruiz
>
>
>
> "nano2k" wrote:
> > Hello
>
> > Is there a difference between:
>
> > 1.
> > Application.Lock();
> > try {
> >   //...code
> > }
> > finally {
> >   Application.UnLock();
> > }
>
> > pattern and
> > 2.
> > lock(Application) {
> >   //...code
> > }
>
> > ?
>
> > I read on MSDN (http://support.microsoft.com/default.aspx/kb/271787)
> > that there are some situations when the first pattern blocks the
> > service.
>
> > Thanks.- Ascunde citatul -
>
> - Afi are text în citat -


Thanks Luis for your response
What is your recommendation. Should we use pattern 1 or pattern 2?
Date:Thu, 09 Aug 2007 02:31:39 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us