ASP .Net e i thread secondari

Interessantissimo post di Stefano Pronti del nuovo blog MSDN di Supporto Tecnico agli Sviluppatori, che spiega le disastrose conseguenze di non richiamare il metodo Dispose su risorse unmanaged, utilizzate all'interno di una web application.

Per farla breve, le risorse unmanaged utilizzavano un thread secondario rispetto a quello che prende in carico la web request, ed in questo thread secondario veniva sollevata una eccezione non gestita durante la fase di finalizzazione del garbage collector, che, come è noto, viene eseguito in un thread diverso.

In questo caso il comportamento di ASP .NET a partire dalla versione 2.0 è quello di interrompere immediatamente il processo in esecuzione, con conseguenze facilmente immaginabili.

Ho già parlato qui di questo comportamento di ASP .NET e di come sia possibile utilizzare la modalità pre-versione 2.0 di gestione delle eccezioni non gestite sollevate all'interno di thread diversi.

Anche a me è capitato di dover "impazzire" con una applicazione in produzione, abbastanza vasta, che soffriva di frequenti ed improvvise cadute della sessione corrente, con enorme disagio degli utenti.

Nel caso specifico non è stato indispensabile attaccare un debugger per ottenere il dump della memoria al momento dell'eccezione, è bastato debuggare il codice, che non conoscevo neanche bene, e scoprire che venivano creati thread aggiuntivi (!?) il cui codice, in particolari circostanze, sollevava l'eccezione fatale che provocava il riavvio del worker process.

posted @ Monday, September 28, 2009 2:24 AM

Print

Comments on this entry:

# re: ASP .Net e i thread secondari

Left by black hattitude at 10/13/2009 6:42 AM
Gravatar
Hi,


thanks for the great quality of your forum, every time i come here, i'm amazed.
i read your posts regularly and i finaly decided to subscribe.




black hattitude.

# re: ASP .Net e i thread secondari

Left by http:// at 10/17/2009 4:57 PM
Gravatar
I want my abs to show a little more, already doing some excersising but I have decided to take additional supplements.

Now I heard about this thing called Acai Force Max, was wondering if anyone here ever tried it succesfully? Thanks for your advice..

BTW Don't fall for that loophole with free acai trials, they're not free, they'll charge you for you S+H

# re: rolex

Left by rolex at 3/8/2010 10:18 AM
Gravatar
replica watches To celebrate its 125th anniversary, BVLGARI replica watches presented a watch dedicated to the fake watches founder of the Bvlgari empire – the Bvlgari omega watches Sotirio Quantieme Annuel. Creating this replica rolex timepiece, the watchmakers of the omega brand took a more modern breitling approach to the classic style. BVLGARI reinterpreted the cartier formal watch and created something totally new and distinctive. The cartier watches Bvlgari Sotirio Quantieme Annuel has a traditional round case tag heuer and a leather strap, but the inside of the breitling watches case and the dial are not at all traditional panerai watches and boring.The armani watches timepiece is powered by the BVL 360 Calibre, an in-house movement audemars piguet featuring annual calendar and 225° retrograde date complications. The latter one means that the date bvlgari watches hand, moving along a 225° arc, jumps back to “1” at movado watches midnight of the last day of each month.The montblanc watches dial of the Bvlgari Sotirio Quantieme Annuel watch combines patek philippe different textures. The hand-applied Roman numerals replica watches and indexes are faceted, while other elements of the rolex watches dial have a satin finish-surface. The case of the watch is also treated in different ways to achieve an interesting aesthetic tag heuer effect

# re: ASP .Net e i thread secondari

Left by rolex at 3/8/2010 10:21 AM
Gravatar
replica watches hands of the watch, as well as the rolex watches hour and minute counters at 3 breitling watches and 9 o’clock are rose-gold toned, while the cartier watches seconds sub-dial at 6 o’clock comes patek philippe in different colors, depending on the omega watches color pattern of the dial.Bvlgari Sotirio Quantieme omega AnnuelThere is always a person behind a company, a breitling driving force whose values shape a cartier brand policy. The person behind BVLGARI is audemars piguet Sotirio Bulgari. Having come from montblanc watches Greece to seek his fortune in Italy, the panerai watches jeweller founded the company bvlgari watches which has grown into a multinational luxury brand with a armani watches few product lines including replica watcheshandbags, fragrances, tag heuer accessories, hotels and rolex watches.

Your comment:



 (will not be displayed)


 
 
 
Please add 6 and 1 and type the answer here:
 

Live Comment Preview:

 
«March»
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910