I've recently encountered an issue with the multi-threaded nature of the BizTalk Mapper and how it handles external assemblies.
As this quote from MSDN indicates:
Important Any code written in an
external assembly for use in a
scripting…
I have a WCF service and I have the following (simplified) class:
public class PerOperationSingleton : IDisposable
{
private static bool _hasInstance = false;
public PerOperationSingleton()
{
if(_hasInstance)
throw…
I am using C# and NUnit framework for executing multiple test in separate threads simultaneously. I want to record the time between certain actions and have created an ActionTimeHelper class for the same.
Below is the code for the class and the…
I have created a library which is using threadstatic variables to be used by various classes of the same library. Once initialized for a thread, all these classes work together to achieve a task using these variables.
Now i need to use this same…
I have veeeeryyy basic singleton in asp.net web application:
[ThreadStatic]
private static BackgroundProcessManager2 _Instance;
public static BackgroundProcessManager2 Instance
{
get
{
if (_Instance == null) // **
{
…
I have a static variable which is accessed by multiple threads in multiple object. The problem is if I set value in one thread it does not reflect in another thread.
To resolve the issue I made the variable thread static but still the value…
well this has been bugging me for a couple of days on and off. I am at a clients site where they have a number of bespoke, written in house, services running on a Windows 2008R2 IIS server. The problem is that a couple of these services keep…
Can I use an external assembly's static method like [ThreadStatic] method?
Here is my situation.
The assembly class (which I do not have access to its source) has this structure
public class RegistrationManager()
{
private RegistrationManager()…
Quick question regarding ThreadStatic and ThreadLocal in C#, specifically .Net Core 3.1.6..
I would rather not post the exact example but it's very similar to this:
[ThreadStatic]
static readonly Object LocalObject = new Object();
I then access…