Skip to content

Commit

Permalink
transport: #389
Browse files Browse the repository at this point in the history
  • Loading branch information
csegarragonz committed Mar 1, 2024
1 parent 5c7afeb commit 3f0f4d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions include/faabric/transport/PointToPointBroker.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ class PointToPointBroker
private:
faabric::util::SystemConfig& conf;

// If the PTP server is single-threaded, we can shortcut a lot of the
// complexity associated with ordering messages
const bool isServerSingleThreaded = true;

std::shared_mutex brokerMutex;

std::unordered_map<int, std::set<int>> groupIdIdxsMap;
Expand Down
3 changes: 1 addition & 2 deletions src/transport/PointToPointBroker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -788,8 +788,7 @@ std::pair<MessageResponseCode, int> PointToPointBroker::doRecvMessage(
void PointToPointBroker::recvMessage(PointToPointMessage& msg,
bool mustOrderMsg)
{
// If we don't need to receive messages in order, return here
if (!mustOrderMsg) {
if (!mustOrderMsg || isServerSingleThreaded) {
doRecvMessage(msg);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/transport/PointToPointServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PointToPointServer::PointToPointServer()
POINT_TO_POINT_ASYNC_PORT,
POINT_TO_POINT_SYNC_PORT,
POINT_TO_POINT_INPROC_LABEL,
faabric::util::getSystemConfig().pointToPointServerThreads)
1) // faabric::util::getSystemConfig().pointToPointServerThreads)
, broker(getPointToPointBroker())
{}

Expand Down

0 comments on commit 3f0f4d7

Please sign in to comment.