Shared memory programming slower w/newer compilers vs older compilers

I have a series of c++ batch programs that run concurrently and use shared memory to pass data between them. The programs are built for windows and UNIX with appropriate code for each using semaphores, mutex, etc.

The shared memory code/libs were written many years ago by a consultant and have worked flawlessly for many years.

This year we upgraded compilers/operating systems to VS2010 for windows and AIX 7. Previously we had to work off 10+ year old compilers.

Everything still works, but we are having significant performance problems. In logging, I have narrowed down to where delays are occurring.

For Windows it is when we do WaitForSingleObject(m_HANDLE, INFINITE);
For UNIX it is when we do semop(m_HANDLE,&sb,1);

I am reading up on this type of primitive coding and it is slow going.

My question is does anyone know of anything in terms of modern operating systems and/or compilers that would cause this type of programming to run slower than older operating systems/compilers?
Most likely the slowdown comes from the OS update, not the compiler update.

Everything still works, but we are having significant performance problems. In logging, I have narrowed down to where delays are occurring.

For Windows it is when we do WaitForSingleObject(m_HANDLE, INFINITE);
For UNIX it is when we do semop(m_HANDLE,&sb,1);
These functions merely suspend execution until a condition is met (e.g. an event gets triggered, a mutex gets released, a thread returns, etc.). If that condition takes longer to be met, they're going to wait longer. The problem is not these functions, but whatever is executing while these functions wait.

In principle, nothing in your post jumps up as obviously wrong design. My guess would be that some specific aspect of the implementation took advantage of some low/semi-low level detail that changed in the intervening time. For example, a program could become seriously slower if it continued to assume that a device was random access after it became sequential.
Topic archived. No new replies allowed.