Skip to content

thread pool support#6

Open
boeschf wants to merge 21 commits intomasterfrom
thread_pool_support
Open

thread pool support#6
boeschf wants to merge 21 commits intomasterfrom
thread_pool_support

Conversation

@boeschf
Copy link
Owner

@boeschf boeschf commented Nov 13, 2019

Using a thread-safe continuation communicator (which has thread-safe lock-free queues) we can dispatch transports to a thread pool and attach "continuations" using callbacks!
feedback is welcome!

public: // member types

using tag_type = int;
using rank_type = int;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using future_type = cont_detail::any_future

std::function<void(message_arg_type, rank_type, tag_type)> m_cb;
rank_type m_rank;
tag_type m_tag;
cont_detail::any_future m_future;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cont_detail::any_future m_future;
future_type m_future;

private: // implementation

template<typename Comm, typename Message, typename CallBack>
request send(Comm& comm, Message& msg, rank_type dst, tag_type tag, CallBack&& cb, std::false_type)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not with enable_if... ?

request send(Comm& comm, Message& msg, rank_type dst, tag_type tag, CallBack&& cb, std::false_type)
{
using V = typename Message::value_type;
request req{std::make_shared<cont_detail::request_state>()};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe another typedef for cont_detail::request_state?

boeschf pushed a commit that referenced this pull request Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants