<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:40:03 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[GODRIVER-3094] Use atomic.Value instead of sync.RWMutex to provide atomic read/writes to values</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-3094</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;h3&gt;&lt;a name=&quot;Context&quot;&gt;&lt;/a&gt;&lt;b&gt;Context&lt;/b&gt;&lt;/h3&gt;
&lt;p&gt;Go&apos;s &lt;tt&gt;atomic.Value&lt;/tt&gt; type can perform a lot better than using a &lt;tt&gt;sync.RWMutex&lt;/tt&gt; to guard values, especially when the use case is read-heavy and has a lot of concurrent contention. See some benchmarks &lt;a href=&quot;https://gist.github.com/dim/152e6bf80e1384ea72e17ac717a5000a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;. We should use &lt;tt&gt;atomic.Value&lt;/tt&gt; instead of a &lt;tt&gt;snc.RWMutex&lt;/tt&gt; in those cases.&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;Definitionofdone&quot;&gt;&lt;/a&gt;&lt;b&gt;Definition of done&lt;/b&gt;&lt;/h3&gt;
&lt;ul&gt;
	&lt;li&gt;Replace all uses of &lt;tt&gt;sync.RWMutex&lt;/tt&gt; to guard values that are read frequently and written infrequently with &lt;tt&gt;atomic.Value&lt;/tt&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;&lt;a name=&quot;Pitfalls&quot;&gt;&lt;/a&gt;&lt;b&gt;Pitfalls&lt;/b&gt;&lt;/h3&gt;
&lt;p&gt;&lt;tt&gt;atomic.Value&lt;/tt&gt; is not as useful for write-heavy or read-write balanced use cases. We should only use it for read-heavy use cases.&lt;/p&gt;

&lt;p&gt;Note that we can&apos;t use most of the new types in the &lt;tt&gt;atomic&lt;/tt&gt; package because they were added with Go 1.19.&lt;br/&gt;
&lt;font color=&quot;&quot;&gt;&lt;/font&gt;&lt;/p&gt;

</description>
                <environment></environment>
        <key id="2542962">GODRIVER-3094</key>
            <summary>Use atomic.Value instead of sync.RWMutex to provide atomic read/writes to values</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</priority>
                        <status id="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="matt.dale@mongodb.com">Matt Dale</reporter>
                        <labels>
                    </labels>
                <created>Thu, 11 Jan 2024 05:24:48 +0000</created>
                <updated>Fri, 12 Jan 2024 20:57:25 +0000</updated>
                                                                                                <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                        <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                        <customfield id="customfield_23812" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Assigned Team</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="26446"><![CDATA[Go Drivers]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i2pg18:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>