diff options
author | Russell Bryant <russell@russellbryant.com> | 2006-11-26 06:55:33 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2006-11-26 06:55:33 +0000 |
commit | a3adf3e7543b59d2cfe4abfbf3d6ee36fc4cbdd3 (patch) | |
tree | 27f5dafc52841bc4a34f1306553a0f513afa6855 /include/asterisk/threadstorage.h | |
parent | 17eba0de3d401e3b02481cf91033a004d911e830 (diff) |
- Add some comments on thread storage with a brief explanation of what it is
as well as what the motivation is for using it.
- Add a comment by the declaration of ast_inet_ntoa() noting that this function
is not reentrant, and the result of a previous call to the function is no
longer valid after calling it again.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/threadstorage.h')
-rw-r--r-- | include/asterisk/threadstorage.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/asterisk/threadstorage.h b/include/asterisk/threadstorage.h index d13b616f0..4886d3520 100644 --- a/include/asterisk/threadstorage.h +++ b/include/asterisk/threadstorage.h @@ -21,7 +21,20 @@ * \author Russell Bryant <russell@digium.com> * * \brief Definitions to aid in the use of thread local storage -*/ + * + * The POSIX threads (pthreads) API provides the ability to define thread + * specific data. The functions and structures defined here are intended + * to centralize the code that is commonly used when using thread local + * storage. + * + * The motivation for using this code in Asterisk is for situations where + * storing data on a thread-specific basis can provide some amount of + * performance benefit. For example, there are some call types in Asterisk + * where ast_frame structures must be allocated very rapidly (easily 50, 100, + * 200 times a second). Instead of doing the equivalent of that many calls + * to malloc() and free() per second, thread local storage is used to keep a + * list of unused frame structures so that they can be continuously reused. + */ #ifndef ASTERISK_THREADSTORAGE_H #define ASTERISK_THREADSTORAGE_H |