Nick
Sat Oct 25 02:19:54 CDT 2003
The easiest option would be to wrap the single-thread object in a .NET
object that was thread-safe:
public class DataSourceWrapper{
private static object _dataSource = new DataSource();
public static void UseDataSource( /*add required params here*/){
lock(typeof(DataSourceWrapper)){
//code to use _dataSource here;
}
}
}
If the single-threaded API is used to service a lot of requests, there will
be a significant performance and scalability problem on the site.
Nick Wienholt, MVP
Maximizing .NET Performance
http://www.apress.com/book/bookDisplay.html?bID=217
Sydney Deep .NET User Group www.sdnug.org
"Abdul Rahman" <anonymous@discussions.microsoft.com> wrote in message
news:060701c39aad$5a2faf00$a501280a@phx.gbl...
> Hi,
> I am using a API to access a Datasource in a Web
> Application.The API is purely single threaded.
> When there are more than one user trying to access the
> data.the API crashes and this inturn kills the ASpnet
> worker process.
>
> Can anybody help me out with how to proceed to write a
> Wrapper class so that i can achieve crash free experience.
>
> Any help will be highly appreciated
>
> Regards
> Abdul Rahman