sc::ShmMemoryGrp(3)

πŸ“¦
version 2.3.1 Β· 5 versions
, in ubuntu jammy

πŸ’– NAME πŸ’–

okay bestie, this is the sc::ShmMemoryGrp(3) page from MPQC β€” and the tea is: the ShmMemoryGrp concrete class provides an implementation of MsgMemoryGrp. That's the whole NAME section, but make it cute: it's giving "shared-memory group has entered the chat" πŸ’….

✨ SYNOPSIS ✨

#include <memshm.h>

Inherits sc::MsgMemoryGrp.

πŸ’… Public Member Functions πŸ’…

  • ShmMemoryGrp (const Ref< MessageGrp > &msg) β€” constructor vibes with a const Ref< MessageGrp > &msg.
  • ShmMemoryGrp (const Ref< KeyVal > &) β€” constructor vibes with a const Ref< KeyVal > &.
  • void set_localsize (size_t) β€” set the size of locally held memory. πŸŽ€
  • void * localdata () β€” returns a pointer to the local data. periodt.
  • void * obtain_readwrite (distsize_t offset, int size) β€” only one thread can have an unreleased obtain_readwrite at a time. that's the rule, bestie.
  • void * obtain_readonly (distsize_t offset, int size) β€” gives read access to the memory location. No locking is done. like, none at all πŸ™ˆ.
  • void * obtain_writeonly (distsize_t offset, int size) β€” gives write access to the memory location. No locking is done. same energy.
  • void release_readonly (void *data, distsize_t offset, int size) β€” called when read access is no longer needed. release the ghost πŸ‘».
  • void release_writeonly (void *data, distsize_t offset, int size) β€” called when write access is no longer needed.
  • void release_readwrite (void *data, distsize_t offset, int size) β€” called when read/write access is no longer needed.
  • void print (std::ostream &o=ExEnv::out0()) const β€” prints out information about the object. default arg is right there, and it's const.

🫢 Additional Inherited Members 🫢

This heading is here in the original too, bestie β€” and it doesn't list any extra bullet details under it. mysterious inherited-member energy, iykyk. ✨

🌸 Detailed Description 🌸

The ShmMemoryGrp concrete class provides an implementation of MsgMemoryGrp. no cap.

It uses SYSV IPC to provide shared memory on a system that provides shared memory in hardware. It is very fast and reliable. literally iconic.

πŸ”₯ Member Function Documentation πŸ”₯

πŸ’œ void* sc::ShmMemoryGrp::obtain_readwrite (distsize_t offset, int size) πŸ’œ

[virtual]

Only one thread can have an unreleased obtain_readwrite at a time. The actual memory region locked can be larger than that requested. If the memory region is already locked this will block. For this reason, data should be held as read/write for as short a time as possible. so don't hold it forever, bestie 😭.

Implements sc::MemoryGrp.

πŸ’– void sc::ShmMemoryGrp::release_readwrite (void * data, distsize_t offset, int size) πŸ’–

[virtual]

This is called when read/write access is no longer needed. The memory will be unlocked. slay, release it. ✨

Implements sc::MemoryGrp.

πŸ¦‹ void sc::ShmMemoryGrp::set_localsize (size_t) πŸ¦‹

[virtual]

Set the size of locally held memory. When memory is accessed using a global offset counting starts at node 0 and proceeds up to node n() - 1. that's the whole journey, no cap. 🫢

Reimplemented from sc::MsgMemoryGrp.

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for MPQC from the source code. the robots wrote it, not me πŸ’….


✨ cute sign-off: this sc::ShmMemoryGrp(3) page is from MPQC version 2.3.1, dated Sun Oct 4 2020 β€” thanks for reading, bestie, mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from