Dynamic b-threads
From BP Wiki
Dynamic b-threads
- B-threads are normally instantiated and added to the b-program in the runBApplication method.
- However, b-threads can also be created dynamically in two ways:
- Any thread or b-thread can create a new instance of the desired b-thread class, and call the bp.add method to add the b-thread to the b-program, and call the bthread.start method to start the b-thread. The b-thread will join the running b-threads in the next synchronization point.
- A running Java thread which is not a b-thread, may register itself as a b-thread and subsequently deregister, using the method calls XXXXXX and YYYYYY.
- Examples: