Click here to Skip to main content
15,897,113 members
Home / Discussions / C#
   

C#

 
GeneralRe: project Pin
ZurdoDev12-Apr-12 1:47
professionalZurdoDev12-Apr-12 1:47 
GeneralRe: project Pin
RobCroll11-Apr-12 18:52
RobCroll11-Apr-12 18:52 
QuestionExport Mutiple DataGridView to Multiple Sheets in an Excel File ... Pin
nassimnastaran11-Apr-12 8:15
nassimnastaran11-Apr-12 8:15 
QuestionPlease help me on using this codeproject Pin
aquahoya11-Apr-12 6:39
aquahoya11-Apr-12 6:39 
AnswerRe: Please help me on using this codeproject Pin
Richard MacCutchan11-Apr-12 6:55
mveRichard MacCutchan11-Apr-12 6:55 
AnswerRe: Please help me on using this codeproject Pin
Big Daddy Farang11-Apr-12 7:24
Big Daddy Farang11-Apr-12 7:24 
AnswerRe: still having problem =( Pin
aquahoya11-Apr-12 7:46
aquahoya11-Apr-12 7:46 
GeneralRe: still having problem =( Pin
Big Daddy Farang11-Apr-12 9:07
Big Daddy Farang11-Apr-12 9:07 
GeneralRe: still having problem =( Pin
aquahoya11-Apr-12 9:34
aquahoya11-Apr-12 9:34 
GeneralRe: OMG u did it!!! =) Pin
aquahoya11-Apr-12 9:57
aquahoya11-Apr-12 9:57 
GeneralRe: OMG u did it!!! =) Pin
Big Daddy Farang11-Apr-12 10:03
Big Daddy Farang11-Apr-12 10:03 
QuestionDo u find c# descent? Pin
Mark Kruger11-Apr-12 5:13
Mark Kruger11-Apr-12 5:13 
AnswerRe: Do u find c# descent? Pin
BobJanova11-Apr-12 5:21
BobJanova11-Apr-12 5:21 
AnswerRe: Do u find c# descent? Pin
PIEBALDconsult11-Apr-12 5:41
mvePIEBALDconsult11-Apr-12 5:41 
GeneralRe: Do u find c# descent? Pin
Mark Kruger11-Apr-12 6:13
Mark Kruger11-Apr-12 6:13 
AnswerRe: Do u find c# descent? Pin
Eddy Vluggen11-Apr-12 7:04
professionalEddy Vluggen11-Apr-12 7:04 
GeneralRe: Do u find c# descent? Pin
Mark Kruger11-Apr-12 7:38
Mark Kruger11-Apr-12 7:38 
GeneralRe: Do u find c# descent? Pin
BobJanova11-Apr-12 23:52
BobJanova11-Apr-12 23:52 
GeneralRe: Do u find c# descent? Pin
Mark Kruger12-Apr-12 1:29
Mark Kruger12-Apr-12 1:29 
AnswerRe: Do u find c# descent? Pin
V.11-Apr-12 21:04
professionalV.11-Apr-12 21:04 
Questionsolid edge programming Pin
issSTE11-Apr-12 3:48
issSTE11-Apr-12 3:48 
AnswerRe: solid edge programming Pin
Richard MacCutchan11-Apr-12 5:06
mveRichard MacCutchan11-Apr-12 5:06 
JokeRe: solid edge programming Pin
ZurdoDev11-Apr-12 8:34
professionalZurdoDev11-Apr-12 8:34 
JokeRe: solid edge programming Pin
Richard MacCutchan11-Apr-12 21:54
mveRichard MacCutchan11-Apr-12 21:54 
Questionfind solution for deadlock Pin
numeracy11-Apr-12 0:21
numeracy11-Apr-12 0:21 
can anybody help me in solving this deadlock?
C#
class Program
    {
        readonly static object obj1 = new object();
        readonly static object obj2 = new object();

        static void F1()
        {
            lock (obj1)
                lock (obj2)
                {
                    Console.Write("1");
                }
        }
        static void F2()
        {
            lock (obj2)
                lock (obj1)
                {
                    Console.Write("2");
                }
        }

        static void Main(string[] args)
        {
            Task[] tasks = new[]
            {
                Task.Factory.StartNew(() => { for (int i = 0; i < 100; i++) F1(); }),
                Task.Factory.StartNew(() => { for (int i = 0; i < 100; i++) F2(); }),
            };
            Task.WaitAll(tasks);
            Console.WriteLine();
            Console.WriteLine("all done");
        }
    }

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.