#include volatile unsigned int c=0xbeef; int inc(int i) { i++; if(i==0)i=1; return i; } int main() { int thread=_clone(); if(thread!=0) // thread 1 { while(1) { c++; } } else // thread2 { while(1) printf("0x%08x\n",c); } }