Skip to content

Commit 21edc11

Browse files
committed
Add note about threads freeing cache with FP_ECC
1 parent bd5f99e commit 21edc11

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

wolfSSL/src/chapter09.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ In addition to header file location changes, the release of wolfSSL 2.0.0 RC3 cr
3838

3939
## Thread Safety
4040

41-
wolfSSL (formerly CyaSSL) is thread safe by design. Multiple threads can enter the library simultaneously without creating conflicts because wolfSSL avoids global data, static data, and the sharing of objects. The user must still take care to avoid potential problems in two areas.
41+
wolfSSL (formerly CyaSSL) is thread safe by design. Multiple threads can enter the library simultaneously without creating conflicts because wolfSSL avoids global data, static data, and the sharing of objects. The user must still take care to avoid potential problems in some areas.
4242

4343
1. A client may share an WOLFSSL object across multiple threads but access must be synchronized, i.e., trying to read/write at the same time from two different threads with the same SSL pointer is not supported.
4444

@@ -48,6 +48,8 @@ wolfSSL (formerly CyaSSL) is thread safe by design. Multiple threads can enter t
4848

4949
Again, multiple threads should synchronize writing access to a `WOLFSSL_CTX` and it is advised that a single thread initialize the `WOLFSSL_CTX` to avoid the synchronization and update problem described above.
5050

51+
3. Some optimizations allocate memory on a per thread basis. If fixed point ECC cache is enabled (`FP_ECC`), then threads should release the cached buffers using `wc_ecc_fp_free()` before the thread exits.
52+
5153
## Input and Output Buffers
5254

5355
wolfSSL now uses dynamic buffers for input and output. They default to 0 bytes and are controlled by the `RECORD_SIZE` define in `wolfssl/internal.h`. If an input record is received that is greater in size than the static buffer, then a dynamic buffer is temporarily used to handle the request and then freed. You can set the static buffer size up to the `MAX_RECORD_SIZE` which is 2^16 or 16,384.

0 commit comments

Comments
 (0)