Re: [algogeeks] what will be the logic for this OS question?

2012-12-08 Thread naveen bansal
It wont work on any system actually. Suppose a case in which lock = 0 initially. And two threads are trying to execute the Critical Section. Thread 1 just passed the if branch and is about to execute the statement lock = 1; just before that context switch happened. Thread 2 will also enter into

Re: [algogeeks] Sieve

2012-12-08 Thread majeti dinesh
To deal with multiples of 2 (only), you can refer the book Parallel Programming in C With Mpi and Openmp - Michael Jay Quinn There he also mentions about cache optimizatoin. On Sat, Dec 8, 2012 at 2:44 AM, Don wrot

Re: [algogeeks] Re: HOW TO CALCULATE THA size of union

2012-12-08 Thread shiv narayan
but when i compile it on Dev C it gives 24..whats the reason ? On Fri, Dec 7, 2012 at 7:19 AM, Don wrote: > The actual size is system dependent because the language doesn't > specify the size of int or long int. > I'll assuming the common convention that sizeof(int)=4 and sizeof(long > int)=8. >