[jira] [Commented] (XERCESC-2140) Add MutexMgr for C++11 mutex implementation

2018-03-01 Thread Roger Leigh (JIRA)

[ 
https://issues.apache.org/jira/browse/XERCESC-2140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16382791#comment-16382791
 ] 

Roger Leigh commented on XERCESC-2140:
--

As an aside, this is something I wrote last July but didn't have time to finish 
for 3.2.0.  I got time over the last couple of days to finish it off (primarily 
the autoconf options handling and documentation).

> Add MutexMgr for C++11 mutex implementation
> ---
>
> Key: XERCESC-2140
> URL: https://issues.apache.org/jira/browse/XERCESC-2140
> Project: Xerces-C++
>  Issue Type: Improvement
>  Components: Utilities
>Affects Versions: 3.2.1
>Reporter: Roger Leigh
>Assignee: Roger Leigh
>Priority: Major
> Attachments: 0001-StdMutexMgr-Add-C-11-mutex-manager.patch
>
>
> Xalan currently supports two mutex managers: POSIX and Windows (and 
> NoThreads, which doesn't really count).  With the advent of C++11, it's no 
> longer necessary to use platform-specific threading facilities, since it's 
> built directly into the standard library.  The attached patch adds a 
> StdMutexMgr which uses a C++11 mutex, and will work on Unix or Windows 
> systems with a sufficiently new compiler.  thread/mutex were implemented 
> years ago, so all recent and not so recent systems should support it.  For 
> those that don't, it will fall back to the POSIX/Windows managers and behave 
> like before.
>  
> Options have been added to manually select the desired manager as for other 
> options for both cmake and autoconf (standard/posix/windows/nothreads).  
> Documented in more detail on the build page.
>  
> It's tested on Linux/MacOS X/Windows with a variety of manager combinations, 
> and all looks fine so far.  Any testing/comments much appreciated.  It's a 
> compatible addition, so could go into 3.2.2 if that's acceptable, otherwise 
> could wait for later.
>  
> Looking at all of the manager implementations, one key defect (likely 
> intentional design), is that there is zero exception safety.  No currently 
> held mutex will be released if an exception gets thrown.  That could be 
> prevented by moving to using C++11 threading entirely, and using 
> std::lock_guard, which will automatically release locks on unwind.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Created] (XERCESC-2140) Add MutexMgr for C++11 mutex implementation

2018-03-01 Thread Roger Leigh (JIRA)
Roger Leigh created XERCESC-2140:


 Summary: Add MutexMgr for C++11 mutex implementation
 Key: XERCESC-2140
 URL: https://issues.apache.org/jira/browse/XERCESC-2140
 Project: Xerces-C++
  Issue Type: Improvement
  Components: Utilities
Affects Versions: 3.2.1
Reporter: Roger Leigh
Assignee: Roger Leigh
 Attachments: 0001-StdMutexMgr-Add-C-11-mutex-manager.patch

Xalan currently supports two mutex managers: POSIX and Windows (and NoThreads, 
which doesn't really count).  With the advent of C++11, it's no longer 
necessary to use platform-specific threading facilities, since it's built 
directly into the standard library.  The attached patch adds a StdMutexMgr 
which uses a C++11 mutex, and will work on Unix or Windows systems with a 
sufficiently new compiler.  thread/mutex were implemented years ago, so all 
recent and not so recent systems should support it.  For those that don't, it 
will fall back to the POSIX/Windows managers and behave like before.

 

Options have been added to manually select the desired manager as for other 
options for both cmake and autoconf (standard/posix/windows/nothreads).  
Documented in more detail on the build page.

 

It's tested on Linux/MacOS X/Windows with a variety of manager combinations, 
and all looks fine so far.  Any testing/comments much appreciated.  It's a 
compatible addition, so could go into 3.2.2 if that's acceptable, otherwise 
could wait for later.

 

Looking at all of the manager implementations, one key defect (likely 
intentional design), is that there is zero exception safety.  No currently held 
mutex will be released if an exception gets thrown.  That could be prevented by 
moving to using C++11 threading entirely, and using std::lock_guard, which will 
automatically release locks on unwind.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



[jira] [Updated] (XERCESC-2140) Add MutexMgr for C++11 mutex implementation

2018-03-01 Thread Roger Leigh (JIRA)

 [ 
https://issues.apache.org/jira/browse/XERCESC-2140?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Roger Leigh updated XERCESC-2140:
-
Attachment: 0001-StdMutexMgr-Add-C-11-mutex-manager.patch

> Add MutexMgr for C++11 mutex implementation
> ---
>
> Key: XERCESC-2140
> URL: https://issues.apache.org/jira/browse/XERCESC-2140
> Project: Xerces-C++
>  Issue Type: Improvement
>  Components: Utilities
>Affects Versions: 3.2.1
>Reporter: Roger Leigh
>Assignee: Roger Leigh
>Priority: Major
> Attachments: 0001-StdMutexMgr-Add-C-11-mutex-manager.patch
>
>
> Xalan currently supports two mutex managers: POSIX and Windows (and 
> NoThreads, which doesn't really count).  With the advent of C++11, it's no 
> longer necessary to use platform-specific threading facilities, since it's 
> built directly into the standard library.  The attached patch adds a 
> StdMutexMgr which uses a C++11 mutex, and will work on Unix or Windows 
> systems with a sufficiently new compiler.  thread/mutex were implemented 
> years ago, so all recent and not so recent systems should support it.  For 
> those that don't, it will fall back to the POSIX/Windows managers and behave 
> like before.
>  
> Options have been added to manually select the desired manager as for other 
> options for both cmake and autoconf (standard/posix/windows/nothreads).  
> Documented in more detail on the build page.
>  
> It's tested on Linux/MacOS X/Windows with a variety of manager combinations, 
> and all looks fine so far.  Any testing/comments much appreciated.  It's a 
> compatible addition, so could go into 3.2.2 if that's acceptable, otherwise 
> could wait for later.
>  
> Looking at all of the manager implementations, one key defect (likely 
> intentional design), is that there is zero exception safety.  No currently 
> held mutex will be released if an exception gets thrown.  That could be 
> prevented by moving to using C++11 threading entirely, and using 
> std::lock_guard, which will automatically release locks on unwind.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



Re: Build Error for windows platform for Xerces-C++ Project

2018-03-01 Thread Roger Leigh

On 01/03/18 03:28, manas mohanty wrote:

Hi Scott,

Thanks for the quick answer.

I have first done CMake for the generation of project files for Visual 
studio 2012 platform. But I do see there is some issue with the cmake 
command which is not generating the *Xerces_autoconf_config.hpp and 
config.h *file.


Please let me know if the below CMake command is proper or I need to change.

 >> cmake -G "Visual Studio 11 2012 Win64" 
-DCMAKE_INSTALL_PREFIX=C:\libs -DCMAKE_INSTALL_LIBDIR=C:\libs 
C:\xerces-c-3.2.0\src


For the -D options, use ":PATH=c:\libs".  The :PATH is needed to tell 
CMake that you are providing a filepath, so that it gets converted into 
a normalised path.  The source directory is fine without since cmake 
converts it for you.  None of that should affect the header generation 
though.


The headers are generated in the *build tree*, not the source tree. 
They can be the same, but if you're building from a different location, 
that's where they will be placed.  This contains the project files as 
well.  If you build in this location, then install, you'll get a working 
build.


See 
https://ci.appveyor.com/project/ApacheSoftwareFoundation/xerces-c/history 
for the continuous integration builds which test this.  It should work 
fine.  You'll need to walk us through *exactly* what you did, and what 
the error messages are, because I'm guessing based upon the information 
you provided what might be wong.



Regards,
Roger

-
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org



RE: Build Error for windows platform for Xerces-C++ Project

2018-03-01 Thread Cantor, Scott
> I have first done CMake for the generation of project files for Visual studio
> 2012 platform. But I do see there is some issue with the cmake command
> which is not generating the Xerces_autoconf_config.hpp and config.h file.

I suspect you just don't know where to look, but I don't support this library 
in the sense of helping you use it, and I'm no CMake expert, sorry.

-- Scott