threadtest example program: Description: The program threadtest is a program that allows the caller to create some threads that do some simple work. It displays a window with three numbered buttons. Clicking on one of the buttons creates one or more threads that does some simple work. The number on the button indicate how many threads will be created by clicking on that button. Next to each button is a label. The created thread will use that label to let you know that the thread is running. You can run threadtest in the WorkShop debugger to experiment with the multi-threaded capabilities of the debugger. Usage: threadtest Example Scenario: Step 1: Make a copy of the program Copy the contents of the memerror directory to your own private working area with the following command: cp -r /opt/SUNWspro/examples/WorkShop/threadtest ~/threadtest NOTE: /opt/SUNWspro is the base directory where the product is installed. This directory maybe different in your environment. Step 2: Start WorkShop and open the threadtest project. Start WorkShop with the "workshop" command. Since we have already provided a project file for you, select Project->Open Project... and select the threadtest.prd project that is already in your working area. Step 3: Build your own copy of the threadtest executable. From the WorkShop main window, go to the Build menu and select the "threadtest in ..." target in the lower part of the menu. This launches a build of the program, bringing up the build-output window. The program should build successfully. Close the Build Output window when done. (or) Point WorkShop's Build window to the memerror directory by selecting 'Build->New Target ...' from either the main window, or from the Build window if it's already open. A dialog pops-up. Change the value of 'Directory' to the location of threadtest and select 'threadtest' as the new 'Target'. Click the 'Build' button on the dialog. Step 4: Run the program under the debugger. From the WorkShop main window, select Debug->New Program... and fill out the resulting dialog box to tell the debugger that you want to debug the threadtest executable. The debug window along with your editor of choice should come up. You can now use the debugger to set breakpoints, step through the code, and otherwise explore. Try setting a breakpoint in myThread() and using the debugger "Threads" tab to explore individual threads. Please see the documentation for more information on using the debugger. Copyright 2000 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303, U.S.A. All rights reserved.