<feed xmlns='http://www.w3.org/2005/Atom'>
<title>viewer.git/indra/test/sync.h, branch cef_147</title>
<subtitle>Megapahit's fork of the Second Life viewer.
</subtitle>
<id>https://megapahit.org/viewer.git/atom?h=cef_147</id>
<link rel='self' href='https://megapahit.org/viewer.git/atom?h=cef_147'/>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/'/>
<updated>2024-04-29T04:56:09Z</updated>
<entry>
<title>#824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed</title>
<updated>2024-04-29T04:56:09Z</updated>
<author>
<name>Andrey Lihatskiy</name>
<email>alihatskiy@productengine.com</email>
</author>
<published>2024-04-29T04:43:28Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=1b68f71348ecf3983b76b40d7940da8377f049b7'/>
<id>urn:sha1:1b68f71348ecf3983b76b40d7940da8377f049b7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Merged in DRTVWR-540-syncpatch (pull request #796)</title>
<updated>2021-12-02T20:08:02Z</updated>
<author>
<name>Nat Linden</name>
<email>nat@lindenlab.com</email>
</author>
<published>2021-12-02T20:08:02Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=79c6557f16f7f41104299e5b157dcd9d2932ee2a'/>
<id>urn:sha1:79c6557f16f7f41104299e5b157dcd9d2932ee2a</id>
<content type='text'>
DRTVWR-540: Make Sync test failure more informative

* DRTVWR-540: Make Sync test failure more informative


Approved-by: Andrey Kleshchev
Approved-by: Andrey Lihatskiy</content>
</entry>
<entry>
<title>DRTVWR-476: Use a longer default timeout for Sync class.</title>
<updated>2020-04-03T14:54:37Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2020-04-03T14:54:37Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=d979ba68ee91404d5d3037701e49eb26286109f5'/>
<id>urn:sha1:d979ba68ee91404d5d3037701e49eb26286109f5</id>
<content type='text'>
The timeout is meant to prevent a deadlocked test program from hanging a
build. It's not intended to ensure some sort of SLA for the operations under
test. Empirically, using a longer timeout helps some test programs. The only
downside of increasing the timeout is that if some test does hang, it takes
longer to notice. But changes on the order of a few seconds are negligible.
</content>
</entry>
<entry>
<title>DRTVWR-476: Make Sync::bump() atomic, add set() method.</title>
<updated>2020-03-25T23:24:25Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2019-12-09T19:33:56Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=3cd2beb97ef0d368d47b0b7efd242b3c709d01af'/>
<id>urn:sha1:3cd2beb97ef0d368d47b0b7efd242b3c709d01af</id>
<content type='text'>
Using Sync with multiple threads is trickier than with coroutines. In
particular, Sync::bump() was racy (get() and set() as two different
operations), and threads were proceeding when they should have waited.

Fortunately LLCond, on which Sync is based, already supports atomic update
operations. Use that for bump().

But to nail things down even more specifically, add set(n) to complement
yield_until(n). Using those methods, there should be no ambiguity about which
call in one thread synchronizes with which call in the other thread.
</content>
</entry>
<entry>
<title>DRTVWR-476: Add Sync class to help with stepwise coroutine tests.</title>
<updated>2020-03-25T22:44:04Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2019-09-11T13:33:07Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=d7c2e4a77bed665d7ab626d9955c35db8c318e95'/>
<id>urn:sha1:d7c2e4a77bed665d7ab626d9955c35db8c318e95</id>
<content type='text'>
Sync is specifically intended for test programs. It is based on an
LLScalarCond&lt;int&gt;. The idea is that each of two coroutines can watch for the
other to get a chance to run, indicated by incrementing the wrapped int and
notifying the wrapped condition_variable. This is less hand-wavy than calling
llcoro::suspend() and hoping that the other routine will have had a chance to
run.

Use Sync in lleventcoro_test.cpp.

Also refactor lleventcoro_test.cpp so that instead of a collection of static
data requiring a clear() call at start of each individual test function, the
relevant data is all part of the test_data struct common to all test
functions. Make the helper coroutine functions members of test_data too.

Introduce llcoro::logname(), a convenience function to log the name of the
currently executing coroutine or "main" if in the thread's main coroutine.
</content>
</entry>
</feed>
