LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-31-2012, 12:45 AM   #1
rcjugdar
LQ Newbie
 
Registered: May 2012
Posts: 1

Rep: Reputation: Disabled
Exclamation Share memory performance in Linux over windows (Synchronization overhead : Semaphore)


This post is regarding calculating the performance of share memory in linux over windows.
i am newbie to linux development.
I have write client server application that calculates how many packets(size 2048 bytes) from share memory are transfered from client (process 1) to server (process 2) in 1 seconds.

In windows i am using
CreateFileMapping
OpenFileMapping
MapViewOfFile
fuctions & for share memory synchronization i am using named events(createevent) in both client & server so that at a time read or write operation can be performed in share memory block.
also i am using circular buffer inside structure as share memory block so it will became 512 share block of size 4096

struct block{
BYTE Data[4096];
long amount;
}

struct MemBuffer{
block m_Blocks[512];
...
...
}
some sort of logic is implemented so that it will work as FIFO manner.

Now In case of linux I am using posix share memory api
shm_open
ftruncate
mmap

share memory block is same (as mentioned above for windows) for synchronization semaphore is used
i am using event based synchronization example : server is wait mode(sem_wait) when no data to read, client write data in share memory it raises event(sem_post) so server gets that event and start reading now when reader is reading that same share memory block write cant write in that block in my case i am using circular buffer so it get 512 block of data for read write so wait events should not occure all the time but i guess it is occuring thats why performance is not that good

now performance

windows count is 700000 packet per seconds
linux count is 500000 packet per seconds using named semaphore
linux count is 600000 packet per seconds using unnamed semaphore

according my observation overhead in this whole application is synchronization so can anybody suggest me better approach for synchronization or how to improve overall performance of share memory in linux?

I am using dual boot machine with windows 2003 server & Red Hat Enterprise Linux 6.0. machine configuration are as follows Intel Quad Core with 2.4 Ghz , 4GB RAM

thanks in advance

Last edited by rcjugdar; 05-31-2012 at 01:11 AM. Reason: duplication
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
synchronization of two processes with share memory icoming Programming 2 02-28-2011 12:16 AM
What's the purpose of the extra virtual memory overhead for 64-bit libraries? ddenisen Linux - Software 4 11-05-2008 04:39 AM
mount windows share export to samba share -> improve network performance tuning newuser77 Linux - Server 1 07-23-2008 12:28 PM
Hi semaphore and shared memory rammu_sivraj Linux - Newbie 4 06-29-2006 12:49 PM
shared memory/semaphore problem V_Ganesh Programming 1 03-31-2005 11:58 PM


All times are GMT -5. The time now is 08:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration