safe (1,963)


Thread safe lazy construction of a singleton in C++

Thread safe lazy construction of a singleton in C++

Is there a way to implement a singleton object in C++ that is: Lazily constructed in a thread safe manner(two threads might simultaneously be the first user of the singleton-it should still only be co…


Is the C# static constructor thread safe?

In other words, is this Singleton implementation thread safe: public class Singleton{private static Singleton instance; private Singleton(){} static Singleton(){instance=new Singleton();}public static…


Is accessing a variable in C# an atomic operation?

I've been raised to believe that if multiple threads can access a variable, then all reads from and writes to that variable must be protected by synchronization code, such as a "lock" statement, becau…


c# - Cleanest Way to Invoke Cross-Thread Events

I find that the.NET event model is such that I'll often be raising an event on one thread and listening for it on another thread. I was wondering what the cleanest way to marshal an event from a backg…


Database: What is Multiversion Concurrency Control(MVCC) and who supports it?

Recently Jeff has posted regarding his trouble with database deadlocks related to reading. Multiversion Concurrency Control(MVCC) claims to solve this problem. What is it, and what databases suppo…


Automated script to zip IIS logs?

I'd like to write a script/batch that will bunch up my daily IIS logs and zip them up by month. ex080801.log which is in the format of exyymmdd.log ex080801.log-ex080831.log gets zipped up and the…


version control - Visual Source Safe--> TFS Migration

Around here we have been working with a bunch of Visual Source Safe repositories for about 10 years or so. Now I want to get rid of sourcesafe and move on to Team Foundation Server. Do you have any…


Shorthand conditional in C# similar to SQL 'in' keyword

In C# is there a shorthand way to write this: public static bool IsAllowed(int userID){return(userID== Personnel.JohnDoe || userID== Personnel.JaneDoe...);}Like: public static bool IsAllo…


graphics - How to convert.ICO to.PNG?

What tool can I use to convert a.ICO file to a.PNG file?…



What do people find so appealing about dynamic languages?

It seems that everybody is jumping on the dynamic, non-compiled bandwagon lately. I've mostly only worked in compiled, static typed languages(C, Java,.Net). The experience I have with dynamic lang…




thread example java how not and variable list string class