[CDRIVER-4220] Consider removal of obsolete sync implementation code Created: 06/Nov/21  Updated: 10/Feb/23

Status: Backlog
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Unknown
Reporter: Roberto Sanchez Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

In poking around at bson-compat.h, I noticed this section of code:

#if defined(__GNUC__)
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)
#define bson_sync_synchronize() __sync_synchronize ()
#elif defined(__i386__) || defined(__i486__) || defined(__i586__) || \
   defined(__i686__) || defined(__x86_64__)
#define bson_sync_synchronize() asm volatile("mfence" ::: "memory")
#else
#define bson_sync_synchronize() asm volatile("sync" ::: "memory")
#endif
#elif defined(_MSC_VER)
#define bson_sync_synchronize() MemoryBarrier ()
#endif

The conditional around whether or not to use __sync_synchronize () is based on a GCC version of 4.1. However, the oldest GCC version we use (e.g., for building/testing in Evergreen) is 4.4 on RHEL 6 and 4.8 on Ubuntu 14.04. That would make most of this conditional obsolete and we should consider removal of the dead branches.


Generated at Wed Feb 07 21:20:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.