Synchronizing a Set of Threads

To synchronize a set of threads, set a thread synchronization breakpoint (thread syncpoint) on the Code tab of the Create Breakpoint dialog box. Enter its location into the Location field, and the threads you want to synchronize into the Thread Filter field. Optionally, you can specify a Condition, an Action, and a Skip number.

To set a thread syncpoint:

  1. Select Debug > Create Breakpoint …

    The Create Breakpoint dialog box appears.

  2. Under Type, selectThread Syncpoint.
  3. In the Location field, enter one of the following expressions:
  4. Optionally, define a condition for the breakpoint in the Condition field, such as choice == 2. The condition is evaluated after the stop of the application at the breakpoint that is specified in the Location field. If the condition is not fulfilled, the application continues executing. For valid conditions see Set Breakpoint Dialog Box: Code Tab.
  5. Optionally, enter a debugger command into the Action field. When the breakpoint stops execution, the commands is executed.
  6. Optionally, define a skip number in the Skip Count field. The skip count number defines the number of times a breakpoint hit is ignored. For example, a breakpoint with the skip number 2 would stop execution when encountered for the third time.
  7. Optionally, check Continue. The target application continues executing after processing the action. If Continue is unchecked, it will stop.
  8. Enter the thread IDs of the threads you want to synchronize, into the Thread Filter field. Specify thread IDs with integer values, as shown in the Threads window. Separate multiple thread IDs with commas. To specify thread sets, use the following syntax: t:[start_id:end_id]. Alternatively, click Browse to select one or more thread sets.

    The breakpoint creates a thread barrier. When any thread in a thread set reaches this barrier, it is frozen, and the debugger ignores any attempt to step or continue execution, until all other threads in the thread set have reached the barrier.

    If you manually stop execution before all threads in the thread set have reached the barrier, the debugger continues to hold all threads in the thread set until all of them reach the thread syncpoint.

  9. Optionally, enter the threads you want to be thawed when the breakpoint was hit and the possible action was performed, into the Stopping Threads field.
  10. Click OK.

Note iconNote

The breakpoint appears at the beginning of the line. For example, a breakpoint at source code line 100 stops the application after line 99 executes.

See Also


Submit feedback on this help topic

Copyright © 2001-2011, Intel Corporation. All rights reserved.