Re: How to build OpenPegasus SDK as single threaded?
Pranav S <[email protected]>
| Newsgroups | gmane.network.open-pegasus.general |
|---|---|
| Message-ID | <CAOGgbh2mtfUcyHwA4BWVzg=YrxJUAx0R5PQE8CVqcDdRNVpDeQ@mail.gmail.com> |
On HP UX we cannot mix single threaded libraries with, multi-threaded ones. It might cause undefined behaviour. And, if an application links to multi-threaded library directly or indirectly, it has to be built with multi-threading (-mt option) enabled. As I am not using multi threaded piece of code from pegcommon(src/Common), I am expecting it to be disabled. Why unnecessarily create a dependency on pthread library? I believe it is good to have a flag in configure files for enabling/disabling the multi-threading. On 6 April 2012 22:00, Kirk Augustin <[email protected]> wrote: > But if you turned off multi threading in Pegasus, you would create and > ensure the very condition you are concerned about avoiding. > You would cause a single threaded library to be linked with multi threaded > ones. > The only safe solution is to make sure Pegasus is multi treaded, so that > you avoid the possibility of a single threaded library being linked to a > multi threaded one. > There is no risk in a multi threaded library linking to a single threaded > one because a single threaded library gets multiple copies. > Only the other way around is risky. > There is only one copy of a multi threaded library, and you do not want > single threaded libraries linking because then more than one could end up > linking at the same time. > > Kirk Augustin > 11821 NW McNamee Rd > Portland, OR 97231 > > HM: 503-289-4356 > > ------------------------------ > *From:* Pranav S <[email protected]> > *To:* Devchandra Leishangthem <[email protected]> > *Cc:* [email protected] > *Sent:* Friday, April 6, 2012 4:38 AM > *Subject:* Re: How to build OpenPegasus SDK as single threaded? > > I some where read, on HPUX and AIX linking single threaded libraries to > multi threaded causes undefined behaviour. Hence I was trying to to build > openpegasus libs as single threaded. I see libpegcommon uses pthread > library. I would like to know if there is way to turnoff the > multithreading. In HPUX Makefiles I see "-mt" option being used to enable > threads support. > > I see Pegasus/Common has thread pool implementation, which is not always > being used by the applications consuming OenPegasus SDK. > Let me know if I am wrong somewhere. > > Thank You, > Pranav > > On 6 April 2012 16:22, Devchandra Leishangthem <[email protected]>wrote: > > Is there any specifi reason why you wanted to build uni-threaded? > Warm Regards > D>L> Meetei > IBM India System and Technology Lab > EGL -D,Bangalore, India > > > > From: Pranav S <[email protected]> > To: [email protected], > Date: 04/06/2012 04:06 PM > Subject: How to build OpenPegasus SDK as single threaded? > > > > Hello, > > I am trying to explore OpenPegasus SDK and its applications. Currently the > SDK uses multi threading and links to pthreads library, hence it gets built > as a multithreaded. I would like to know is it possible to build the > library as single threaded? Do we have provision for that in the Makefiles. > I tried exploring but did not find anything which tells that it is possible > to build the library as single threaded one. Because linking a single > threaded library to a multithreaded library can lead to undefined > behaviour. > > -- > Thanks, > Pranav > > > > > > -- > Thanks, > Pranav > > > > -- Thanks, Pranav