Connection Pool -- Locking, Concurrent Access

This is a discussion on Connection Pool -- Locking, Concurrent Access within the Aix forums, part of the Unix category; Sorry for all my previous posts let me explain the exact problem There is a singleton object in the shared memory. It conatins a pool of connection objects to a ...

Go Back   Unix Linux Forum > Unix > Aix

FixUnix.com - Unix Linux Forums

Unix Content Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-26-2008, 12:17 AM
Default Connection Pool -- Locking, Concurrent Access

Sorry for all my previous posts

let me explain the exact problem

There is a singleton object in the shared memory. It conatins a pool of connection objects to a server. (more likely an array of connection objects).
I want to go through the array and find which connection object is free to access.

Then that particular object is locked, used for connection and then unlocked.
The following is the singleton object which encapsulates the connection pool array.

class single
{
private:
~single();
single();
connectionObj[5];
public:
connectionObj & GetConnectionObj() ;
void Lock();
void UnLock();
}

There are at least 8 processes that are simultaneously accessing the singleton object.

I want a synchronization between all these process and want to implement GetconnectionObj() function. How to implement it and where the locks must be used.

Should the locks be while accessing singleton object or while acessing the connection object, or both

please explain me with the help of code

Thanks in advance

Regards
VADAN
Reply With Quote
Reply

Thread Tools


All times are GMT -5. The time now is 01:09 AM.

In an effort to better serve ads to our visitors, cookies are used on Fixunix.com. For more information, check out our Privacy Policy.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Ad Management by RedTyger