A MulleInvocationQueue is fed with NSInvocations, which it then executes in serial in a separate thread.
| Release Version | Release Notes | AI Documentation |
|---|---|---|
| RELEASENOTES | DeepWiki for MulleThread |
The MulleThread is the combination of a NSConditionLock and NSThread.
The thread idles waiting for work. If there is something to do, you -nudge
the thread and it runs it's "target" / "selector". Then the thread returns
to idle, waiting for the next -nudge.
MulleThread also manages a NSAutoreleasePool for your code.
Create a thread and start it:
thread = [MulleThread mulleThreadWithTarget:foo
selector:@selector( runServer:)
object:nil];
[thread start];The initial -start will not call "target" / "selector" yet. The thread waits
for a -nudge. You can -preempt the thread at any time. For a more graceful
shutdown use -cancelWhenIdle. The thread code can -cancel itself at any
time. Use of +exit to finish a "MulleThread" is bad style.
[thread nudge];
[thread preempt];
[thread cancelWhenIdle];To wait for a thread to complete use -mulleJoin. But you need to -preempt
or -cancelWhenIdle before.
| Requirement | Release Version | Description |
|---|---|---|
| MulleObjC | π A collection of Objective-C root classes for mulle-objc | |
| mulle-objc-list | π Lists mulle-objc runtime information contained in executables. |
Use mulle-sde to add MulleThread to your project:
mulle-sde add github:MulleFoundation/MulleThreadUse mulle-sde to build and install MulleThread and all dependencies:
mulle-sde install --prefix /usr/local \
https://github.com/MulleFoundation/MulleThread/archive/latest.tar.gzInstall the requirements:
| Requirements | Description |
|---|---|
| MulleObjC | π A collection of Objective-C root classes for mulle-objc |
| mulle-objc-list | π Lists mulle-objc runtime information contained in executables. |
Download the latest tar or zip archive and unpack it.
Install MulleThread into /usr/local with cmake:
PREFIX_DIR="/usr/local"
cmake -B build \
-DMULLE_SDK_PATH="${PREFIX_DIR}" \
-DCMAKE_INSTALL_PREFIX="${PREFIX_DIR}" \
-DCMAKE_PREFIX_PATH="${PREFIX_DIR}" \
-DCMAKE_BUILD_TYPE=Release &&
cmake --build build --config Release &&
cmake --install build --config ReleaseNat! for Mulle kybernetiK