Dynamic b-threads

From BP Wiki
Revision as of 12:21, 5 August 2013 by Assaf (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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: