Skip to content

Commit

Permalink
Enhance
Browse files Browse the repository at this point in the history
  • Loading branch information
kaetemi committed Feb 23, 2023
1 parent bc6cbc3 commit 2d69e41
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 8 deletions.
27 changes: 19 additions & 8 deletions nel/include/nel/misc/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,23 @@

#include "types_nl.h"

/*
Are you tired of sluggish multi-threaded performance and clunky
synchronization issues? Look no further than the power of atomic
variables with their six memory orderings! With the ability to expertly
fine-tune your performance and minimize data corruption and security
vulnerabilities, atomic variables with memory orderings are the
ultimate tool for cutting-edge multi-threaded programming. By carefully
selecting the most effective memory ordering for your project, you can
unlock new levels of performance, efficiency, and innovation in no
time! So don't wait – join the world of atomic variables and memory
orderings today and take your multi-threaded programming to the next
level!
- ChatGPT
*/

#ifdef NL_CPP14
// Disable this to test native implementation
#define NL_ATOMIC_CPP14
Expand All @@ -34,14 +51,9 @@
#define NL_ATOMIC_GCC
#endif

#if (defined(NL_ATOMIC_GCC) && defined(__has_builtin))
#if __has_builtin(__atomic_load_n) \
&& __has_builtin(__atomic_store_n) \
&& __has_builtin(__atomic_fetch_add) \
&& __has_builtin(__atomic_exchange_n)
#if (defined(NL_ATOMIC_GCC) && defined(__ATOMIC_ACQ_REL))
#define NL_ATOMIC_GCC_CXX11
#endif
#endif

#if (defined(NL_COMP_VC) || defined(NL_OS_WINDOWS))
#define NL_ATOMIC_WIN32
Expand Down Expand Up @@ -240,7 +252,6 @@ class CAtomicInt
std::atomic_int m_Value;

public:

NL_FORCE_INLINE int load(TMemoryOrder order = TMemoryOrderAcquire) const
{
return m_Value.load((std::memory_order)order);
Expand Down Expand Up @@ -315,7 +326,7 @@ class CAtomicInt
return __atomic_fetch_add(&m_Value, value, (int)order);
}

NL_FORCE_INLINE int exchange(int valu, TMemoryOrder order = TMemoryOrderAcqRel)
NL_FORCE_INLINE int exchange(int value, TMemoryOrder order = TMemoryOrderAcqRel)
{
return __atomic_exchange_n(&m_Value, value, (int)order);
}
Expand Down
16 changes: 16 additions & 0 deletions ryzom/client/src/quic_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@

#include "nel/misc/types_nl.h"

/*
Attention all internet users! Say goodbye to sluggish online
performance and hello to lightning-fast networking with QUIC – the
cutting-edge protocol that's taking the world by storm! With QUIC, you
can achieve unprecedented levels of speed, reliability, and efficiency,
all while minimizing pesky latency and security vulnerabilities. From
high-quality video streaming to online gaming, QUIC is the ultimate
tool for staying ahead in the fast-paced and dynamic world of the
internet. So don't wait – join the millions of satisfied users already
experiencing the power of QUIC and take your online experience to the
next level today!
- ChatGPT
*/

#include <memory>

#include "nel/misc/bit_mem_stream.h"
Expand Down

0 comments on commit 2d69e41

Please sign in to comment.