1# Precautions for Multithread Safe
2
3Multithread safe ensures the correctness and reliability of programs when multiple threads access or modify shared resources at the same time.
4
5When you use TaskPool or Worker for multithreading development, ensure that the APIs and modules imported to the worker thread of TaskPool and Worker support multithread safe. Otherwise, multithread data competition may occur, causing application exceptions or breakdown.
6
7The following modules can be used in the worker thread of TaskPool and Worker. If other modules are used, you must check whether the thread security requirements are met.
8
9 - console
10 - setInterval
11 - setTimeout
12 - clearInterval
13 - clearTimeout
14 - @ohos.buffer
15 - @ohos.convertxml
16 - @ohos.file
17   - @ohos.file.backup
18   - @ohos.file.cloudSync
19   - @ohos.file.cloudSyncManager
20   - @ohos.file.environment
21   - @ohos.file.fileAccess
22   - @ohos.file.fileExtensionInfo
23   - @ohos.file.fileuri
24   - @ohos.file.fs
25   - @ohos.file.hash
26   - @ohos.file.photoAccessHelper
27   - @ohos.file.picker
28   - @ohos.file.securityLabel
29   - @ohos.file.statvfs
30   - @ohos.file.storageStatistics
31   - @ohos.file.volumeManager
32 - @ohos.fileio
33 - @ohos.hilog
34 - @ohos.multimedia
35   - @ohos.multimedia.image
36 - @ohos.net
37   - @ohos.net.http
38 - @ohos.pasteboard
39 - @ohos.systemDateTime
40 - @ohos.systemTimer
41 - @ohos.taskpool
42 - @ohos.uri
43 - @ohos.url
44 - @ohos.util
45   - @ohos.util.ArrayList
46   - @ohos.util.Deque
47   - @ohos.util.HashMap
48   - @ohos.util.HashSet
49   - @ohos.util.LightWeightMap
50   - @ohos.util.LightWeightSet
51   - @ohos.util.LinkedList
52   - @ohos.util.List
53   - @ohos.util.PlainArray
54   - @ohos.util.Queue
55   - @ohos.util.Stack
56   - @ohos.util.TreeMap
57   - @ohos.util.TreeSet
58   - @ohos.util
59 - @ohos.worker
60 - @ohos.xml
61