You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Steve Huston (JIRA)" <qp...@incubator.apache.org> on 2008/10/21 01:24:44 UTC

[jira] Created: (QPID-1377) C++ Refactor asynch level to enable easier Windows porting

C++ Refactor asynch level to enable easier Windows porting
----------------------------------------------------------

                 Key: QPID-1377
                 URL: https://issues.apache.org/jira/browse/QPID-1377
             Project: Qpid
          Issue Type: Improvement
          Components: C++ Broker, C++ Client
            Reporter: Steve Huston
            Assignee: Steve Huston
         Attachments: aio.diff

This issue is in preparation for the rest of the Windows porting. It's by itself because it deals with refactoring/splitting some of the existing qpid/sys modules to better prepare for adding the Windows code. Most of these ideas have been reviewed a few times by Andrew Stitcher in the past, though some of the AsynchIO splitting is new (I'll explain why below).

Here's the high level overview:

- Poller::Direction names IN and OUT change to INPUT and OUTPUT to avoid clashing with Windows-defined macros. Yucky, but that's life.
- DispatcHandle - split out of Dispatcher.h, .cpp to new files DispatchHandle.h, .cpp - makes it easier to reuse Dispatcher for Windows; DispatchHandle is not needed.
- qpid::sys::AsynchIO turns into a pure virtual interface class; platforms derive from it and whatever else they need to implement correctly for the platform. This is for two reasons:
    1. The previous approach discussed was to basically redefine/implement AsynchIO as needed in Windows, then for every place where AsynchIO is used, clone the file and edit to use Windows. This was working ok, but recently a number of changes were made to the cloned-and-copied sources and it became clear that the copy-and-edit approach was going to cause me way too many headaches to deal with over time.
    2. Uses of AsynchIO are in client and broker code where there are dynamic allocations, but AsynchIO implementation, as well as its deletions, are in common. As these are split into actual DLLs, having allocations and deletions in different DLLs will cause heap problems on Windows. So, since common does the deletes based on usage and outstanding operations, the allocations are now there in common as well. This is via a new qpid::sys::AsynchIO::create() static method. Each platform implements AsynchIO::create() as it needs; in particular, it allocates a platform-specific class derived from qpid::sys::AsynchIO which neatly hides all the platform messiness behind a virtual interface.

There's also some initial Windows code in the patch - you can ignore things in qpid/sys/windows unless you're really interested in the platform code - it's not related to the Linux code.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (QPID-1377) C++ Refactor asynch level to enable easier Windows porting

Posted by "Steve Huston (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1377?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Huston reopened QPID-1377:
--------------------------------


Ok, Ted. Apologies.

Please try adding

#include "qpid/sys/DispatchHandle.h"

to qpid/sys/ssl/Ssllo.h - meanwhile, I'll try to see why my build didn't get that error.


> C++ Refactor asynch level to enable easier Windows porting
> ----------------------------------------------------------
>
>                 Key: QPID-1377
>                 URL: https://issues.apache.org/jira/browse/QPID-1377
>             Project: Qpid
>          Issue Type: Improvement
>          Components: C++ Broker, C++ Client
>            Reporter: Steve Huston
>            Assignee: Steve Huston
>             Fix For: M4
>
>         Attachments: aio.diff
>
>
> This issue is in preparation for the rest of the Windows porting. It's by itself because it deals with refactoring/splitting some of the existing qpid/sys modules to better prepare for adding the Windows code. Most of these ideas have been reviewed a few times by Andrew Stitcher in the past, though some of the AsynchIO splitting is new (I'll explain why below).
> Here's the high level overview:
> - Poller::Direction names IN and OUT change to INPUT and OUTPUT to avoid clashing with Windows-defined macros. Yucky, but that's life.
> - DispatcHandle - split out of Dispatcher.h, .cpp to new files DispatchHandle.h, .cpp - makes it easier to reuse Dispatcher for Windows; DispatchHandle is not needed.
> - qpid::sys::AsynchIO turns into a pure virtual interface class; platforms derive from it and whatever else they need to implement correctly for the platform. This is for two reasons:
>     1. The previous approach discussed was to basically redefine/implement AsynchIO as needed in Windows, then for every place where AsynchIO is used, clone the file and edit to use Windows. This was working ok, but recently a number of changes were made to the cloned-and-copied sources and it became clear that the copy-and-edit approach was going to cause me way too many headaches to deal with over time.
>     2. Uses of AsynchIO are in client and broker code where there are dynamic allocations, but AsynchIO implementation, as well as its deletions, are in common. As these are split into actual DLLs, having allocations and deletions in different DLLs will cause heap problems on Windows. So, since common does the deletes based on usage and outstanding operations, the allocations are now there in common as well. This is via a new qpid::sys::AsynchIO::create() static method. Each platform implements AsynchIO::create() as it needs; in particular, it allocates a platform-specific class derived from qpid::sys::AsynchIO which neatly hides all the platform messiness behind a virtual interface.
> There's also some initial Windows code in the patch - you can ignore things in qpid/sys/windows unless you're really interested in the platform code - it's not related to the Linux code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (QPID-1377) C++ Refactor asynch level to enable easier Windows porting

Posted by "Steve Huston (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1377?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Huston updated QPID-1377:
-------------------------------

    Attachment: aio.diff

> C++ Refactor asynch level to enable easier Windows porting
> ----------------------------------------------------------
>
>                 Key: QPID-1377
>                 URL: https://issues.apache.org/jira/browse/QPID-1377
>             Project: Qpid
>          Issue Type: Improvement
>          Components: C++ Broker, C++ Client
>            Reporter: Steve Huston
>            Assignee: Steve Huston
>         Attachments: aio.diff
>
>
> This issue is in preparation for the rest of the Windows porting. It's by itself because it deals with refactoring/splitting some of the existing qpid/sys modules to better prepare for adding the Windows code. Most of these ideas have been reviewed a few times by Andrew Stitcher in the past, though some of the AsynchIO splitting is new (I'll explain why below).
> Here's the high level overview:
> - Poller::Direction names IN and OUT change to INPUT and OUTPUT to avoid clashing with Windows-defined macros. Yucky, but that's life.
> - DispatcHandle - split out of Dispatcher.h, .cpp to new files DispatchHandle.h, .cpp - makes it easier to reuse Dispatcher for Windows; DispatchHandle is not needed.
> - qpid::sys::AsynchIO turns into a pure virtual interface class; platforms derive from it and whatever else they need to implement correctly for the platform. This is for two reasons:
>     1. The previous approach discussed was to basically redefine/implement AsynchIO as needed in Windows, then for every place where AsynchIO is used, clone the file and edit to use Windows. This was working ok, but recently a number of changes were made to the cloned-and-copied sources and it became clear that the copy-and-edit approach was going to cause me way too many headaches to deal with over time.
>     2. Uses of AsynchIO are in client and broker code where there are dynamic allocations, but AsynchIO implementation, as well as its deletions, are in common. As these are split into actual DLLs, having allocations and deletions in different DLLs will cause heap problems on Windows. So, since common does the deletes based on usage and outstanding operations, the allocations are now there in common as well. This is via a new qpid::sys::AsynchIO::create() static method. Each platform implements AsynchIO::create() as it needs; in particular, it allocates a platform-specific class derived from qpid::sys::AsynchIO which neatly hides all the platform messiness behind a virtual interface.
> There's also some initial Windows code in the patch - you can ignore things in qpid/sys/windows unless you're really interested in the platform code - it's not related to the Linux code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (QPID-1377) C++ Refactor asynch level to enable easier Windows porting

Posted by "Steve Huston (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641609#action_12641609 ] 

Steve Huston commented on QPID-1377:
------------------------------------

Also checked in a fix for qpid/sys/rdma/RdmaIO.h - I can't build this, but it has the same issue as the ssl code - needs to include "qpid/sys/DispatchHandle.h"
svn revision 706777.

> C++ Refactor asynch level to enable easier Windows porting
> ----------------------------------------------------------
>
>                 Key: QPID-1377
>                 URL: https://issues.apache.org/jira/browse/QPID-1377
>             Project: Qpid
>          Issue Type: Improvement
>          Components: C++ Broker, C++ Client
>            Reporter: Steve Huston
>            Assignee: Steve Huston
>             Fix For: M4
>
>         Attachments: aio.diff
>
>
> This issue is in preparation for the rest of the Windows porting. It's by itself because it deals with refactoring/splitting some of the existing qpid/sys modules to better prepare for adding the Windows code. Most of these ideas have been reviewed a few times by Andrew Stitcher in the past, though some of the AsynchIO splitting is new (I'll explain why below).
> Here's the high level overview:
> - Poller::Direction names IN and OUT change to INPUT and OUTPUT to avoid clashing with Windows-defined macros. Yucky, but that's life.
> - DispatcHandle - split out of Dispatcher.h, .cpp to new files DispatchHandle.h, .cpp - makes it easier to reuse Dispatcher for Windows; DispatchHandle is not needed.
> - qpid::sys::AsynchIO turns into a pure virtual interface class; platforms derive from it and whatever else they need to implement correctly for the platform. This is for two reasons:
>     1. The previous approach discussed was to basically redefine/implement AsynchIO as needed in Windows, then for every place where AsynchIO is used, clone the file and edit to use Windows. This was working ok, but recently a number of changes were made to the cloned-and-copied sources and it became clear that the copy-and-edit approach was going to cause me way too many headaches to deal with over time.
>     2. Uses of AsynchIO are in client and broker code where there are dynamic allocations, but AsynchIO implementation, as well as its deletions, are in common. As these are split into actual DLLs, having allocations and deletions in different DLLs will cause heap problems on Windows. So, since common does the deletes based on usage and outstanding operations, the allocations are now there in common as well. This is via a new qpid::sys::AsynchIO::create() static method. Each platform implements AsynchIO::create() as it needs; in particular, it allocates a platform-specific class derived from qpid::sys::AsynchIO which neatly hides all the platform messiness behind a virtual interface.
> There's also some initial Windows code in the patch - you can ignore things in qpid/sys/windows unless you're really interested in the platform code - it's not related to the Linux code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (QPID-1377) C++ Refactor asynch level to enable easier Windows porting

Posted by "Ted Ross (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641559#action_12641559 ] 

Ted Ross commented on QPID-1377:
--------------------------------

Steve,

Not sure, but I think this commit may have broken the build.  Here's what I'm getting on Fedora 8 on a clean checkout:

 g++ -DHAVE_CONFIG_H -I. -Igen -I./gen -Werror -pedantic -Wall -Wextra -Wno-shadow -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wvolatile-register-var -Winvalid-pch -Wno-system-headers -Woverloaded-virtual -DCONF_FILE=\"/usr/local/etc/qpid/sslclient.conf\" -g -O2 -MT qpid/client/sslconnector_la-SslConnector.lo -MD -MP -MF qpid/client/.deps/sslconnector_la-SslConnector.Tpo -c qpid/client/SslConnector.cpp  -fPIC -DPIC -o qpid/client/.libs/sslconnector_la-SslConnector.o
./qpid/sys/ssl/SslIo.h:45: error: 'DispatchHandle' in namespace 'qpid::sys' does not name a type
./qpid/sys/ssl/SslIo.h:53: error: 'qpid::sys::DispatchHandle' has not been declared
./qpid/sys/ssl/SslIo.h:60: error: expected class-name before '{' token
./qpid/sys/ssl/SslIo.h:79: error: 'DispatchHandle' has not been declared
./qpid/sys/ssl/SslIo.h:112: error: expected class-name before '{' token
./qpid/sys/ssl/SslIo.h:159: error: 'qpid::sys::DispatchHandle' has not been declared
./qpid/sys/ssl/SslIo.h:160: error: 'qpid::sys::DispatchHandle' has not been declared
./qpid/sys/ssl/SslIo.h:161: error: 'qpid::sys::DispatchHandle' has not been declared
./qpid/sys/ssl/SslIo.h:162: error: 'qpid::sys::DispatchHandle' has not been declared
make[3]: *** [qpid/client/sslconnector_la-SslConnector.lo] Error 1
make[3]: Leaving directory `/home/ross/svn/qpid/cpp/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/ross/svn/qpid/cpp/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/ross/svn/qpid/cpp/src'
make: *** [all-recursive] Error 1

-Ted


> C++ Refactor asynch level to enable easier Windows porting
> ----------------------------------------------------------
>
>                 Key: QPID-1377
>                 URL: https://issues.apache.org/jira/browse/QPID-1377
>             Project: Qpid
>          Issue Type: Improvement
>          Components: C++ Broker, C++ Client
>            Reporter: Steve Huston
>            Assignee: Steve Huston
>             Fix For: M4
>
>         Attachments: aio.diff
>
>
> This issue is in preparation for the rest of the Windows porting. It's by itself because it deals with refactoring/splitting some of the existing qpid/sys modules to better prepare for adding the Windows code. Most of these ideas have been reviewed a few times by Andrew Stitcher in the past, though some of the AsynchIO splitting is new (I'll explain why below).
> Here's the high level overview:
> - Poller::Direction names IN and OUT change to INPUT and OUTPUT to avoid clashing with Windows-defined macros. Yucky, but that's life.
> - DispatcHandle - split out of Dispatcher.h, .cpp to new files DispatchHandle.h, .cpp - makes it easier to reuse Dispatcher for Windows; DispatchHandle is not needed.
> - qpid::sys::AsynchIO turns into a pure virtual interface class; platforms derive from it and whatever else they need to implement correctly for the platform. This is for two reasons:
>     1. The previous approach discussed was to basically redefine/implement AsynchIO as needed in Windows, then for every place where AsynchIO is used, clone the file and edit to use Windows. This was working ok, but recently a number of changes were made to the cloned-and-copied sources and it became clear that the copy-and-edit approach was going to cause me way too many headaches to deal with over time.
>     2. Uses of AsynchIO are in client and broker code where there are dynamic allocations, but AsynchIO implementation, as well as its deletions, are in common. As these are split into actual DLLs, having allocations and deletions in different DLLs will cause heap problems on Windows. So, since common does the deletes based on usage and outstanding operations, the allocations are now there in common as well. This is via a new qpid::sys::AsynchIO::create() static method. Each platform implements AsynchIO::create() as it needs; in particular, it allocates a platform-specific class derived from qpid::sys::AsynchIO which neatly hides all the platform messiness behind a virtual interface.
> There's also some initial Windows code in the patch - you can ignore things in qpid/sys/windows unless you're really interested in the platform code - it's not related to the Linux code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (QPID-1377) C++ Refactor asynch level to enable easier Windows porting

Posted by "Steve Huston (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1377?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Huston resolved QPID-1377.
--------------------------------

       Resolution: Fixed
    Fix Version/s: M4

Changes checked in (after testing on RHEL 4) with a windows version of AsynchIO.cpp. SVN revision 706709.

> C++ Refactor asynch level to enable easier Windows porting
> ----------------------------------------------------------
>
>                 Key: QPID-1377
>                 URL: https://issues.apache.org/jira/browse/QPID-1377
>             Project: Qpid
>          Issue Type: Improvement
>          Components: C++ Broker, C++ Client
>            Reporter: Steve Huston
>            Assignee: Steve Huston
>             Fix For: M4
>
>         Attachments: aio.diff
>
>
> This issue is in preparation for the rest of the Windows porting. It's by itself because it deals with refactoring/splitting some of the existing qpid/sys modules to better prepare for adding the Windows code. Most of these ideas have been reviewed a few times by Andrew Stitcher in the past, though some of the AsynchIO splitting is new (I'll explain why below).
> Here's the high level overview:
> - Poller::Direction names IN and OUT change to INPUT and OUTPUT to avoid clashing with Windows-defined macros. Yucky, but that's life.
> - DispatcHandle - split out of Dispatcher.h, .cpp to new files DispatchHandle.h, .cpp - makes it easier to reuse Dispatcher for Windows; DispatchHandle is not needed.
> - qpid::sys::AsynchIO turns into a pure virtual interface class; platforms derive from it and whatever else they need to implement correctly for the platform. This is for two reasons:
>     1. The previous approach discussed was to basically redefine/implement AsynchIO as needed in Windows, then for every place where AsynchIO is used, clone the file and edit to use Windows. This was working ok, but recently a number of changes were made to the cloned-and-copied sources and it became clear that the copy-and-edit approach was going to cause me way too many headaches to deal with over time.
>     2. Uses of AsynchIO are in client and broker code where there are dynamic allocations, but AsynchIO implementation, as well as its deletions, are in common. As these are split into actual DLLs, having allocations and deletions in different DLLs will cause heap problems on Windows. So, since common does the deletes based on usage and outstanding operations, the allocations are now there in common as well. This is via a new qpid::sys::AsynchIO::create() static method. Each platform implements AsynchIO::create() as it needs; in particular, it allocates a platform-specific class derived from qpid::sys::AsynchIO which neatly hides all the platform messiness behind a virtual interface.
> There's also some initial Windows code in the patch - you can ignore things in qpid/sys/windows unless you're really interested in the platform code - it's not related to the Linux code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (QPID-1377) C++ Refactor asynch level to enable easier Windows porting

Posted by "Steve Huston (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1377?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Huston resolved QPID-1377.
--------------------------------

    Resolution: Fixed

I installed the requisite packages to build the ssl support, verified the problem, and fixed it. Committed in svn revision 706775.

> C++ Refactor asynch level to enable easier Windows porting
> ----------------------------------------------------------
>
>                 Key: QPID-1377
>                 URL: https://issues.apache.org/jira/browse/QPID-1377
>             Project: Qpid
>          Issue Type: Improvement
>          Components: C++ Broker, C++ Client
>            Reporter: Steve Huston
>            Assignee: Steve Huston
>             Fix For: M4
>
>         Attachments: aio.diff
>
>
> This issue is in preparation for the rest of the Windows porting. It's by itself because it deals with refactoring/splitting some of the existing qpid/sys modules to better prepare for adding the Windows code. Most of these ideas have been reviewed a few times by Andrew Stitcher in the past, though some of the AsynchIO splitting is new (I'll explain why below).
> Here's the high level overview:
> - Poller::Direction names IN and OUT change to INPUT and OUTPUT to avoid clashing with Windows-defined macros. Yucky, but that's life.
> - DispatcHandle - split out of Dispatcher.h, .cpp to new files DispatchHandle.h, .cpp - makes it easier to reuse Dispatcher for Windows; DispatchHandle is not needed.
> - qpid::sys::AsynchIO turns into a pure virtual interface class; platforms derive from it and whatever else they need to implement correctly for the platform. This is for two reasons:
>     1. The previous approach discussed was to basically redefine/implement AsynchIO as needed in Windows, then for every place where AsynchIO is used, clone the file and edit to use Windows. This was working ok, but recently a number of changes were made to the cloned-and-copied sources and it became clear that the copy-and-edit approach was going to cause me way too many headaches to deal with over time.
>     2. Uses of AsynchIO are in client and broker code where there are dynamic allocations, but AsynchIO implementation, as well as its deletions, are in common. As these are split into actual DLLs, having allocations and deletions in different DLLs will cause heap problems on Windows. So, since common does the deletes based on usage and outstanding operations, the allocations are now there in common as well. This is via a new qpid::sys::AsynchIO::create() static method. Each platform implements AsynchIO::create() as it needs; in particular, it allocates a platform-specific class derived from qpid::sys::AsynchIO which neatly hides all the platform messiness behind a virtual interface.
> There's also some initial Windows code in the patch - you can ignore things in qpid/sys/windows unless you're really interested in the platform code - it's not related to the Linux code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.