[3.5.3] Performance issue with System V semaphore ( semop() )
Abinash Mohanty (amohanty)
Abinash.Mohanty@quest.com
Wed Sep 4 09:18:48 GMT 2024
Hi,
Problem Statement
Our application uses System V semaphore extensively. We are facing performance issue with it.
Problem Description
We have created a sample code (attached with name shm_sem.cpp) which uses System V shared memory and semaphore. This code takes semaphore lock, updates the shared memory and unlock semaphore. It is done in a loop for 50k times. It takes around 21 seconds to complete. We have compiled and executed the same code on Linux which completes instantly. Following is the outcome of run from Cygwin and REHL 7.9 Linux VM:
Cygwin:
uname -a
CYGWIN_NT-10.0-17763 Win19Build01 3.5.3-1.x86_64 2024-04-03 17:25 UTC x86_64 Cygwin
Compiled with : g++ -o shm_sem shm_sem.cpp
shm_sem.exe
2024-09-04 01:23:44.505687 => Starting...
2024-09-04 01:24:05.500330 => Finished...
2024-09-04 01:24:05.500989 => Shared memory and semaphore cleaned up.
RHEL Linux:
uname -a
Linux Linux6BuildDev03 3.10.0-1160.59.1.el7.x86_64 #1 SMP Wed Feb 16 12:17:35 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Compiled with : g++ -o shm_sem shm_sem.cpp
./shm_sem
2024-09-04 08:22:16.302955 => Starting...
2024-09-04 08:22:16.385529 => Finished...
2024-09-04 08:22:16.385631 => Shared memory and semaphore cleaned up.
Is this expected behavior or there are any configuration or any changes you can suggest which might improve its performance will be very helpful.
Attachments:
1. Sample code : shm_sem.cpp
1. Cygserver config file: cygserver.conf
1. Cygcheck output (cygcheck -s -v -r > cygcheck.out): cygcheck.out
Thanks
Abinash Mohanty
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: shm_sem.cpp
URL: <https://cygwin.com/pipermail/cygwin-developers/attachments/20240904/df4d7c92/attachment-0001.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 55905 bytes
Desc: cygcheck.out
URL: <https://cygwin.com/pipermail/cygwin-developers/attachments/20240904/df4d7c92/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygserver.conf
Type: application/octet-stream
Size: 5397 bytes
Desc: cygserver.conf
URL: <https://cygwin.com/pipermail/cygwin-developers/attachments/20240904/df4d7c92/attachment-0003.obj>
More information about the Cygwin-developers
mailing list