[Example] Multi-threaded programming example

This commit is contained in:
Hui Yu
2020-11-02 21:38:52 +08:00
parent 3bdbebcae6
commit 91b5f8aff8
19 changed files with 334 additions and 8 deletions

View File

@@ -125,6 +125,15 @@ list all pods in cluster:
apiClient_unsetupGlobalEnv();
```
## Multi-threaded Usage
If the C client library is used in multi-threaded program, the following 2 actions must be taken:
1. After the program starts up, main thread must call the function ```apiClient_setupGlobalEnv()``` before any worker thread is created.
2. If the C client is no longer used, main thread must call the function ```apiClient_unsetupGlobalEnv()``` after all worker threads end.
Refer to the [example](https://github.com/kubernetes-client/c/tree/master/examples/multi_thread/) for detail.
## Community, discussion, contribution, and support