YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense alongwiththisprogram;ifnot,writetotheFreeSoftware
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
void test_concurrently(constchar *test, pthread_handler handler, int n, int m)
{
pthread_t *threads= malloc(n * sizeof(pthread_t)); int i;
ulonglong now= my_interval_timer();
if (!threads)
BAIL_OUT("malloc failed (out of memory)");
bad= 0;
diag("Testing %s with %d threads, %d iterations... ", test, n, m); for (i= 0; i < n; i++)
{ if (pthread_create(&threads[i], 0, handler, &m) != 0)
{
diag("Could not create thread");
abort();
}
}
for (i= 0; i < n; i++)
pthread_join(threads[i], 0);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.