dplug.core.thread

The thread module provides support for thread creation and management.

Members

Aliases

ThreadDelegate
alias ThreadDelegate = void delegate() nothrow @(nogc)
Undocumented in source.
ThreadPoolDelegate
alias ThreadPoolDelegate = void delegate(int workItem) nothrow @(nogc)
Undocumented in source.
btex_fptr
alias btex_fptr = uint function(void*)
Undocumented in source but is binding to Windows. You might be able to learn more by searching the web for its name.

Classes

ThreadPool
class ThreadPool

Rewrite of the ThreadPool using condition variables. FUTURE: this could be speed-up by using futures. Description of the task and associated condition+mutex would go in an external struct. Note: the interface of the thread-pool itself is not thread-safe, you cannot give orders from multiple threads at once.

Functions

_beginthreadex
uintptr_t _beginthreadex(void* , uint , btex_fptr , void* , uint , uint* )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
currentThreadId
void* currentThreadId()
currentThreadId
void* currentThreadId()
getTotalNumberOfCPUs
int getTotalNumberOfCPUs()
launchInAThread
Thread launchInAThread(ThreadDelegate dg)

Launch a function in a newly created thread, which is destroyed afterwards. Return the thread so that you can call .join() on it.

makeThread
Thread makeThread(ThreadDelegate callback, size_t stackSize)
Undocumented in source. Be warned that the author may not have intended to support it.
posixThreadEntryPoint
void* posixThreadEntryPoint(void* threadContext)
Undocumented in source. Be warned that the author may not have intended to support it.
sysctlbyname
int sysctlbyname(const(char)* , void* , size_t* , void* , size_t )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
windowsThreadEntryPoint
uint windowsThreadEntryPoint(void* threadContext)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

Thread
struct Thread

Optimistic thread, failure not supported

Meta

License

Distributed under the Boost Software License 1.0. (See accompanying file LICENSE)

Authors

Sean Kelly, Walter Bright, Alex Rønne Petersen, Martin Nowak, David Simcha, Guillaume Piolat