Type/to search
Built-in Functions
Global
Log
Market
Trade
Account
Futures
Exchange
IO
Network
Storage
Threads
exchange.Go
EventLoop
ctx.subscribe
ctx.poll
ctx.order
ctx.cancel
ctx.submit
Subscription
threading
threading.Thread
threading.getThread
threading.mainThread
threading.currentThread
threading.Lock
threading.Condition
threading.Event
threading.Dict
threading.Serve
threading.pending
Thread
ThreadLock
ThreadEvent
ThreadCondition
ThreadDict
Server
TA
Talib
OS
Structures
Built-in Variables and Constants
Conventions
Exchanges

A global multi-threading management tool, providing functions for creating concurrent threads, thread locks, condition variables, and more. This section introduces the member functions of the threading object. Only JavaScript language strategies support this object.

In this sectionRead the whole section

NameDescription
threading.ThreadCreates concurrent threads.
threading.getThreadGets a thread object based on the specified thread ID.
threading.mainThreadGets the thread object of the main thread, which is the thread where the main() function in the strategy is located.
threading.currentThreadGets the thread object of the current thread.
threading.LockCreates a thread lock object.
threading.ConditionCreates a condition variable object, which is used to implement synchronization and communication between threads in a multi-threaded concurrent environment.
threading.EventCreates a thread event object, which is used for synchronization between threads, allowing one thread to wait for notification or signal from another thread.
threading.DictCreates a dictionary object for passing and sharing data between concurrent threads.
threading.ServeStarts an HTTP, TCP or WebSocket (over HTTP) service inside the strategy process and returns a Server object.
threading.pendingGets the number of concurrent threads currently running in the strategy program.