Don't call opal_mutex_unlock if there is no progress thread. Now we are
few tens of microsecond faster. This commit was SVN r11339.
Этот коммит содержится в:
родитель
663175df1a
Коммит
b20cdbc651
@ -538,7 +538,9 @@ opal_event_base_loop(struct event_base *base, int flags)
|
|||||||
return(0);
|
return(0);
|
||||||
|
|
||||||
#if OPAL_HAVE_WORKING_EVENTOPS
|
#if OPAL_HAVE_WORKING_EVENTOPS
|
||||||
|
#if OMPI_ENABLE_PROGRESS_THREADS
|
||||||
opal_mutex_lock(&opal_event_lock);
|
opal_mutex_lock(&opal_event_lock);
|
||||||
|
#endif /* OMPI_ENABLE_PROGRESS_THREADS */
|
||||||
|
|
||||||
done = 0;
|
done = 0;
|
||||||
while (!done && opal_event_enabled) {
|
while (!done && opal_event_enabled) {
|
||||||
@ -559,7 +561,9 @@ opal_event_base_loop(struct event_base *base, int flags)
|
|||||||
res = (*event_sigcb)();
|
res = (*event_sigcb)();
|
||||||
if (res == -1) {
|
if (res == -1) {
|
||||||
errno = EINTR;
|
errno = EINTR;
|
||||||
|
#if OMPI_ENABLE_PROGRESS_THREADS
|
||||||
opal_mutex_unlock(&opal_event_lock);
|
opal_mutex_unlock(&opal_event_lock);
|
||||||
|
#endif /* OMPI_ENABLE_PROGRESS_THREADS */
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -583,7 +587,9 @@ opal_event_base_loop(struct event_base *base, int flags)
|
|||||||
|
|
||||||
/* If we have no events, we just exit */
|
/* If we have no events, we just exit */
|
||||||
if (!opal_event_haveevents(base)) {
|
if (!opal_event_haveevents(base)) {
|
||||||
|
#if OMPI_ENABLE_PROGRESS_THREADS
|
||||||
opal_mutex_unlock(&opal_event_lock);
|
opal_mutex_unlock(&opal_event_lock);
|
||||||
|
#endif /* OMPI_ENABLE_PROGRESS_THREADS */
|
||||||
event_debug(("%s: no events registered.", __func__));
|
event_debug(("%s: no events registered.", __func__));
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
@ -598,7 +604,9 @@ opal_event_base_loop(struct event_base *base, int flags)
|
|||||||
|
|
||||||
if (res == -1) {
|
if (res == -1) {
|
||||||
opal_output(0, "opal_event_loop: ompi_evesel->dispatch() failed.");
|
opal_output(0, "opal_event_loop: ompi_evesel->dispatch() failed.");
|
||||||
|
#if OMPI_ENABLE_PROGRESS_THREADS
|
||||||
opal_mutex_unlock(&opal_event_lock);
|
opal_mutex_unlock(&opal_event_lock);
|
||||||
|
#endif /* OMPI_ENABLE_PROGRESS_THREADS */
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -614,7 +622,9 @@ opal_event_base_loop(struct event_base *base, int flags)
|
|||||||
|
|
||||||
event_debug(("%s: asked to terminate loop.", __func__));
|
event_debug(("%s: asked to terminate loop.", __func__));
|
||||||
|
|
||||||
|
#if OMPI_ENABLE_PROGRESS_THREADS
|
||||||
opal_mutex_unlock(&opal_event_lock);
|
opal_mutex_unlock(&opal_event_lock);
|
||||||
|
#endif /* OMPI_ENABLE_PROGRESS_THREADS */
|
||||||
return (base->event_count_active);
|
return (base->event_count_active);
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -19,9 +19,7 @@
|
|||||||
#ifndef OPAL_THREAD_H
|
#ifndef OPAL_THREAD_H
|
||||||
#define OPAL_THREAD_H 1
|
#define OPAL_THREAD_H 1
|
||||||
|
|
||||||
#ifdef __WINDOWS__
|
#if OMPI_HAVE_POSIX_THREADS
|
||||||
#include <windows.h>
|
|
||||||
#elif OMPI_HAVE_POSIX_THREADS
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#elif OMPI_HAVE_SOLARIS_THREADS
|
#elif OMPI_HAVE_SOLARIS_THREADS
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user