sc::PthreadThreadGrp(3)

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

Hey bestie πŸ’– welcome to the MPQC manual page for sc::PthreadThreadGrp(3). We're about to get into some pthread thread group lore, and yes, it's giving serious "I know my way around a build system" energy. ✨


🌸 NAME 🌸

sc::PthreadThreadGrp β€” the PthreadThreadGrp class privides (yes, that's the exact spelling in the original, no cap πŸ’€) a concrete thread group that's appropriate for an environment where pthreads is available. πŸ’…

✨ SYNOPSIS ✨

#include <thpthd.h>

Inherits sc::ThreadGrp.

🌈 Inherits

sc::ThreadGrp.

πŸ‘‘ Public Member Functions

  • PthreadThreadGrp (const PthreadThreadGrp &, int nthread=-1) β€” constructor with a const PthreadThreadGrp & and an int nthread that defaults to -1.
  • PthreadThreadGrp (const Ref< KeyVal > &) β€” constructor with a const Ref< KeyVal > &.
  • int start_threads () β€” starts the threads running.
  • int wait_threads () β€” waits for all the threads to complete.
  • void add_thread (int i, Thread *t) β€” assigns a Thread object to each thread.
  • void add_thread (int i, Thread *t, int priority) β€” like add_thread(threadnum, thread), but assigns a priority that the thread is to use.
  • Ref< ThreadLock > new_lock () β€” returns a local object.
  • ThreadGrp * clone (int nthread=-1) β€” creates a ThreadGrp like the current one.

🫢 Additional Inherited Members

This section is literally just a heading in the original β€” no extra member list is shown here. The inherited stuff is already above, iykyk. πŸ¦‹

πŸ¦‹ Detailed Description πŸ¦‹

The PthreadThreadGrp class privides (again, original spelling πŸ’€) a concrete thread group that's appropriate for an environment where pthreads is available. That's the whole vibe here. ✨

πŸŽ€ Member Function Documentation πŸŽ€

πŸ’– add_thread (int threadnum, Thread * thread)

void sc::PthreadThreadGrp::add_thread (int threadnum, Thread * thread)

[inline], [virtual] β€” this one assigns a Thread object to each thread. If 0 is assigned to a thread, then that thread will be skipped. πŸ’€

Reimplemented from sc::ThreadGrp.

References sc::ThreadGrp::add_thread().

πŸ’– add_thread (int threadnum, Thread * thread, int priority)

void sc::PthreadThreadGrp::add_thread (int threadnum, Thread * thread, int priority)

[virtual] β€” like add_thread(threadnum, thread), but assigns a priority that the thread is to use. The member is primarily for experimentation, and the priority argument is currently not well defined and ignored. So yeah, experimental vibe only. πŸ™ˆ

Reimplemented from sc::ThreadGrp.

✨ clone (int nthread = -1)

ThreadGrp* sc::PthreadThreadGrp::clone (int nthread = -1)

[virtual] β€” creates a ThreadGrp like the current one. If nthread is given, the new ThreadGrp will attempt to support that number of threads, but the actual number supported may be less. If nthread is -1, the number of threads in the current group will be used. 🫢

Reimplemented from sc::ThreadGrp.

πŸ”₯ start_threads ()

int sc::PthreadThreadGrp::start_threads ()

[virtual] β€” starts the threads running. Thread 0 will be run by the thread that calls start_threads. πŸ‘‘

Implements sc::ThreadGrp.

🌈 wait_threads ()

int sc::PthreadThreadGrp::wait_threads ()

[virtual] β€” waits for all the threads to complete. This must be called before start_threads is called again or the object is destroyed. Fr fr, don't skip this step. 😭

Implements sc::ThreadGrp.

⭐ Author ⭐

Doxygen auto-generated this for MPQC straight from the source code.


πŸ’– That's the page, bestie β€” Version 2.3.1, dated Sun Oct 4 2020, and it's the sc::PthreadThreadGrp(3) page. Bye! πŸ’…

πŸ“¦ where this page comes from