SbStorage(3)

πŸ“¦ version 3.1.3, in fedora 43, fedora 44

✨ SbStorage ✨

okay bestie, gather round, because this is SbStorage(3) from the Library Functions Manual and she is lowkey iconic πŸ’–

🌸 NAME 🌸

SbStorage β€” the class that manages thread-local memory, and she does it flawlessly πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <Inventor/threads/SbStorage.h>

✨ Public Member Functions ✨

SbStorage (unsigned int size)
SbStorage (unsigned int size, cc_storage_f *constr, cc_storage_f *destr)
~SbStorage (void)
void * get (void)
void applyToAll (SbStorageApplyFunc *func, void * closure)

πŸ’œ Detailed Description πŸ’œ

okay so, the SbStorage class manages thread-local memory. that's the whole vibe. 🫢

here's the tea though: when different threads access the memory an SbStorage object manages, they will receive different memory blocks back. like, each thread gets its own lil stash. no sharing, no fighting, no drama. ✨

this provides a mechanism for sharing read/write static data. yes bestie, sharing static data while still keeping each thread's block separate β€” it's giving main character energy fr fr.

⚠️ okay now the important implementation detail, pay attention: if the Coin library was explicitly configured to be built without multi-platform thread abstractions, or if neither pthreads nor native Win32 thread functions are available, it will be assumed that the client code will all run in the same thread. which means the same memory block will be returned for any request β€” without considering the current thread id. no cap. so if you were expecting per-thread separation in that setup... you're not getting it, bestie 😭

πŸŽ€ Constructor & Destructor Documentation πŸŽ€

SbStorage::SbStorage (unsigned int size) β€” [inline]

the constructor, periodt. size specifies the number of bytes each thread should have in this thread-local memory management object. so like, you tell her how much room every thread gets, and she handles it. πŸ’–

SbStorage::~SbStorage (void ) β€” [inline]

the destructor. that's it, that's the whole description. she cleans up and exits the group chat gracefully 🌈


πŸ‘‘ Member Function Documentation πŸ‘‘

void * SbStorage::get (void ) β€” [inline]

this method returns the calling thread's thread-local memory block. your block, your thread, your business. πŸ¦‹

void SbStorage::applyToAll (SbStorageApplyFunc * func, void * closure) β€” [inline]

this method will call func for all thread local storage data. and closure will be supplied as the second parameter to the callback. so you get to run your lil function across every thread's stash, and pass along whatever extra goodies you need. slay. πŸ”₯


⭐ Author ⭐

Generated automatically by Doxygen for Coin from the source code. (yes, a robot wrote this, and honestly? she ate. πŸ’…)


and that's the whole page bestie!! πŸ’– this manual page came from Coin, Version 3.1.3, dated with the classic SbStorage(3) footer energy β€” so if you're running Coin 3.1.3, you're in exactly the right place. go forth and manage that thread-local memory, you absolute icon πŸ‘‘βœ¨

πŸ“¦ where this page comes from