Tuesday, March 11, 2008

C++ Threading

Simple way to create thread...
CreateThread()

The thread function is derived from DWORD WINAPI
Suppose the C++ class name is MyClass and we have to implement a thread for Myfunction().

In "MyClass.h" declare and implement the following
////////////////***********************************************/////////////////////
class MyClass
{
private:
HANDLE m_hThread;

void MyFunction() ;
static DWORD WINAPI MyFunctionThreadEntry( IN LPVOID pv)
{
((MyClass*) pv) ->MyFunction() ;
return EXIT_SUCCESS ;
}

MyClass()
{
m_hThread=NULL;
}
/// do other initializations
}
////////////////***********************************************/////////////////////

In "MyClass.cpp" implement the following
////////////////***********************************************/////////////////////
void MyClass::MyFunction()
{
///Add function code
}
////////////////***********************************************/////////////////////

How the thread is invoked?
Call CreateThread to invoke thread function.

DWORD dw=0;
m_hThread=CreateThread (NULL,NULL, (LPTHREAD_START_ROUTINE) MyClass::MyFunctionThreadEntry,
this,
NULL,
& dw
) ;

Viswanathan Anand wins World Chess Championship

Viswanathan Anand wins World Chess Championship
Indian world chess champion Viswanathan Anand defeated Russia's Vladimir Kramnik in a match-play series to retain his title in Bonn, Germany on 29-10-2008


Wednesday, March 5, 2008

India A Rising Economic Power

Since the mid-1980s successive reforms have progressively moved the Indian economy towards a market-based system. State intervention and control over economic activity has been reduced significantly and the role of private-sector entrepreneurship increased. To varying degrees, liberalisation has touched on most aspects of economic policy including industrial policy, fiscal policy, financial market regulation, and trade and foreign investment.
Overall, reform has had a major beneficial impact on the economy
Annual growth in GDP per capita has accelerated from just 1¼ per cent in the three decades after Independence to 7½ per cent currently, a rate of growth that will double average income in a decade. Potential output growth is currently estimated to be 8½ per cent annually and India is now the third largest economy in the world. Increased economic growth has helped reduce poverty, which has begun to fall in absolute terms.
Liberalised areas have grown rapidly
In service sectors where government regulation has been eased significantly or is less burdensome – such as communications, insurance, asset management and information technology – output has grown rapidly, with exports of information technology enabled services particularly strong. In those infrastructure sectors which have been opened to competition, such as telecoms and civil aviation, the private sector has proven to be extremely effective and growth has been phenomenal. At the state level, economic performance is much better in states with a relatively liberal regulatory environment than in the relatively more restrictive states.

Sunday, March 2, 2008

Increase Petrol Disel Mileage by a tablet!!!

Increase your car's mileage by adding a tablet in the petrol/diesel tank!
The new tablet, a highly concentrated fuel additive that will enhance your cars performance and increase your fuel economy.
Increased octane rating in all petrol and diesel fuels
  1. Increased fuel economy
  2. Reduced knock and ping
  3. Effective lead protection replacement
  4. Significantly reduces harmful hydrocarbon emissions
  5. Tablets work in much the same way as the more expensive additives sold in bottles. However, the tablets are less expensive, more effective and easier to use than the older style fuel additives.
  6. The new tablet technology offers distributors and consumers a true Win/Win product, one that pays for itself in fuel savings, makes a positive contribution to cleaner air, and keeps our cars/trucks running smoother.