OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace-cog commits / 5771e22

No special detection of barrier
5771e22b20389dd67df433a4312f098d1e0ba738
by Linas Vepstas <linasvepstas@gmail.com> · 2025-12-07T22:57:24.000Z

Changed files (1) +5 -13

opencog/persist/cog-storage/CogChannel.h +5 -13
……@@ -10,7 +10,7 @@
1010 *
1111 * LICENSE:
1212 * SPDX-License-Identifier: AGPL-3.0-or-later
13 *
13 *
1414 * This program is free software; you can redistribute it and/or modify
1515 * it under the terms of the GNU Affero General Public License v3 as
1616 * published by the Free Software Foundation and including the exceptions
……@@ -84,24 +84,16 @@ class CogChannel
8484 // The mesage buffer is a de-duplicating buffer: identical
8585 // messages are added only once. This makes sense for almost
8686 // all messages: we do not need to store an Atom twice; the
87 // store operation is idempotent. There are two exceptions.
88 // One is the cog-value-increment message: these are never
89 // idempotent; we use a sequence number to make sure each is
90 // unique. The other case is the barrier. The exact same
91 // barrier message must be sent to each socket. The barrier
92 // code will make sure that the queues are all empty before
93 // enqueuing the barrier, so ordering does not matter, but
94 // having exactly NTHREADS copies does. It must not be
95 // deduplicated So that is what this ctor does.
87 // store operation is idempotent. The one exception is the
88 // cog-update-value! message: these are never idempotent;
89 // we use a sequence number to make sure each is unique.
9690 Msg(Client* c, void (Client::*cb)(const std::string&, const Data&),
9791 bool nr, const std::string& str, const Data& d)
9892 : client(c), callback(cb), noreply(nr),
9993 str_to_send(str), data(d)
10094 {
10195 // Non-idempotent messages get unique sequence numbers.
102 // "(cog-barrier " - note trailing space, not closing paren!
103 if (str.compare(0, 19, "(cog-update-value!") == 0 or
104 str.compare(0, 13, "(cog-barrier ") == 0)
96 if (str.compare(0, 19, "(cog-update-value!") == 0)
10597 {
10698 sequence = ++_sequence_counter;
10799 }