You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by alanconway <gi...@git.apache.org> on 2017/07/07 18:12:50 UTC

[GitHub] qpid-proton pull request #109: Cpp drop thread safe

GitHub user alanconway opened a pull request:

    https://github.com/apache/qpid-proton/pull/109

    Cpp drop thread safe

    Make container::connect(), open_sender() etc. return void and remove
    thread_safe<> and returned<>.
    
    With the work_queue changes everything works fine with minor example
    modifications, however it means you must wait till a handler function before you
    can use a connection or link, hence the minor example changes. It would be
    nice to return something that at least provides access to the work_queue.
    
    NOTE: to be memory safe, whatever is returned must do injected proton
    refcounting similar to what thread_safe<> does, to avoid the proton object and
    its work queue being deleted unexpectedly. However it could be a much simpler
    type with a simple internal refcount.
    
    It doesn't need to provide the operator delete override, conversion to
    shared_ptr<> etc. that thread_safe<> does in order to allow proton object
    lifecycles to be controlled by std::c++ smart pointers. That doesn't seem like a
    required feature with the current API, and it could be added back later outside
    the core API if we do ever want it.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/alanconway/qpid-proton cpp-drop-thread-safe

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/qpid-proton/pull/109.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #109
    
----
commit 61e465ae9a4894a003e1f4aaeb52f632519a8a6b
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-01-23T17:32:50Z

    PROTON-1400: [C++ binding] Removed proton_event and proton_handler
    - Removed old low level proton event handling completely
    - Now directly dispatch to the messaging_handler
    - Moved private message::decode directly into message handling code

commit e2c506e8db66e537e7f63f240c8333f9b4987345
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-01-25T04:36:03Z

    PROTON-1400: WIP Use the mt broker example as the example instead of the previous st broker
    - The st broker didn't correctly respect the object access constraints from within handlers

commit 87e377ecae1c0513f50b30804a455b32258eaaf2
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-02-08T07:32:36Z

    PROTON-1400: [C++ binding] Proactor container implementation
    - Remove all reactor use
    - Rearrange object context code
    - Change container includes to proactor container includes
    - Add sender/receiver options API to connection so we never need container in handlers
    - Rework connection_driver remove all use of container
    - Change signature of listener_handler callbacks to supply the listener

commit 221e87725b5feb8b3fab66ca66db1155ef95ddba
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-02-09T01:12:36Z

    PROTON-1400: [C++ binding] Remove reactor container implementation files.

commit 4471e8f54701f93048226923d33eb48172faaf29
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-03-03T20:51:58Z

    NO-JIRA: Header file corrections

commit 84f81e795bbbf47973ea99e94b33eb2af305ae6e
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-03-28T17:45:28Z

    PROTON-1400: [C++ example] Rework broker to use container event loops

commit e9e81224c12782b60501ddc8bca43021cbf327ce
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-04-14T06:13:12Z

    PROTON-1400: [C+ binding] Change semantic for incoming xx_open
    - If not overridden then you get automatic outgoing matching xx_open
    - If overridden then it is assumed you will handle the outgoing open
      yourself.

commit 195fda811d610875a21895b9db210dfb80c35225
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-04-20T19:20:40Z

    PROTON-1400: [C++ binding] Implement container level event_loops

commit 9af923eaea9c8f994e250299d145c1bee9de69cd
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-04-27T17:05:14Z

    PROTON-1471: [C++ binding] Use pn_proactor_now() to implement timestamp::now()

commit cc65a4c397a8cd0491835ee7f778b0d125b8c916
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-05-15T05:27:54Z

    PROTON-1481: [C++ binding] Rename event_loop API to work_queue

commit 4b2695ba65dae55f1dbc91b89b75cda08c3313e1
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-05-15T05:36:52Z

    PROTON-1481: [C++ binding] simplify work_queue code by introducing work type
    - The work type can be created from std::function<void()> or void_function0
    - and so pushes those c++11/C++03 differences into a single place

commit dded51287d8cf2f1d5ae961149adfbb327d0933f
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-05-15T05:45:43Z

    PROTON-1481: [C++ binding] Split out general work deferring functions to the work_queue header
    Add efficient C++11 versions of work factories
    Reorder defer arguments to be like std::bind
    Add extra overloads for defer like std::bind (for free functions arbitrary work_queues)

commit cafe328afe3a629b8b204e5dc10d9987f1a6a44b
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-05-18T17:47:46Z

    PROTON-1481: [C++ binding] Further work on C++03 convenience functions
    - Propagate the result of work_queue::add
    - Fix memory leak of proton::defer if the deferred function can't be called
    - Add make_work convenience in place of std::bind
    - Simplfy defer oveload options - have to specify work_queue

commit bf6fc41d1ed38267e578c5ec864369ccd07a0792
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-05-18T18:14:58Z

    PROTON-1481: [C++ binding] Simplify code to use convenience functions

commit 385f7d900911c6737ea6c3098bc96de7e0a03e9f
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-05-19T04:59:55Z

    PROTON-1482: [C++ binding] Implemented scheduling delaying work on a work_queue

commit 8c823cc8fe39c2ebc97ef61804f71d2d63aab668
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-05-19T05:38:18Z

    PROTON-1482: [C++ binding] Added convenience overload to proton::defer
    for scheduled deferred work
    - Used new conveniences in scheduled_send_03 example

commit 0c35aacc2a495e3cc916e0fbae8690d396b356ec
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-05-19T16:27:17Z

    PROTON-1481: [C++ binding] Added simpler way to get work_queue from model objects

commit 2e894f03169f2fddf463c08273f5b66669a4f14b
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-05-19T21:02:05Z

    PROTON-1481: Rename proton::defer -> proton::schedule_work

commit 1492c28c9a432e352230500b16f5baed3653eb62
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-05-26T21:00:31Z

    PROTON-1400: [C++ binding] Make proactor container thread safe

commit 076b802b960167b6c26484a48ea03678e5f417d9
Author: Andrew Stitcher <as...@apache.org>
Date:   2017-05-26T21:01:00Z

    PROTON-1400: [C++ example] Use multiple threads in broker example if available

commit b69bc2ecd5fce3bc0aa8ac742159225181fcd01b
Author: Alan Conway <ac...@redhat.com>
Date:   2017-07-06T20:25:09Z

    WIP: Drop thread_safe<> and returned<>
    
    Make container::connect(), open_sender() etc. return void and remove
    thread_safe<> and returned<>.
    
    With the work_queue changes everything works fine with minor example
    modifications, however it means you must wait till a handler function before you
    can use a connection or link, hence the minor example changes. It would be
    nice to return something that at least provides access to the work_queue.
    
    NOTE: to be memory safe, whatever is returned must do injected proton
    refcounting similar to what thread_safe<> does, to avoid the proton object and
    its work queue being deleted unexpectedly. However it could be a much simpler
    type with a simple internal refcount.
    
    It doesn't need to provide the operator delete override, conversion to
    shared_ptr<> etc. that thread_safe<> does in order to allow proton object
    lifecycles to be controlled by std::c++ smart pointers. That doesn't seem like a
    required feature with the current API, and it could be added back later outside
    the core API if we do ever want it.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] qpid-proton issue #109: Cpp drop thread safe

Posted by alanconway <gi...@git.apache.org>.
Github user alanconway commented on the issue:

    https://github.com/apache/qpid-proton/pull/109
  
    Issues discussed here were addressed by 
    f1ee2681 PROTON-1554: Remove thread-safe template, simplify returned<>


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] qpid-proton pull request #109: Cpp drop thread safe

Posted by alanconway <gi...@git.apache.org>.
Github user alanconway closed the pull request at:

    https://github.com/apache/qpid-proton/pull/109


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org