2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include <afs/param.h>
16 #include <potpourri.h>
25 LWP_SignalProcess(&semaphore);
33 struct timeval t1, t2;
37 static char c[] = "OtherProcess";
39 count = atoi(argv[1]);
41 assert(LWP_InitializeProcessSupport(0, (PROCESS *) & pid) == LWP_SUCCESS);
42 assert(LWP_CreateProcess
43 (OtherProcess, 4096, 0, 0, c,
44 (PROCESS *) & otherpid) == LWP_SUCCESS);
46 waitarray[0] = &semaphore;
48 gettimeofday(&t1, NULL);
49 for (i = 0; i < count; i++) {
50 LWP_MwaitProcess(1, waitarray, 1);
52 gettimeofday(&t2, NULL);
54 x = (t2.tv_sec - t1.tv_sec) * 1000000 + (t2.tv_usec - t1.tv_usec);
55 printf("%d milliseconds for %d MWaits (%f usec per Mwait and Signal)\n",
56 x / 1000, count, (float)(x / count));