top: overlap some more processing for separate threads

In an effort to improve the performance & decrease the
cost of our separate background update threads we will
relocate some overhead so that it might be overlapped.

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2021-09-22 00:00:00 -05:00 committed by Craig Small
parent d89047659c
commit f11f43b4f7

View File

@ -6356,27 +6356,11 @@ static void frame_make (void) {
WIN_t *w = Curwin; // avoid gcc bloat with a local copy
int i, scrlins;
// check auto-sized width increases from the last iteration...
if (AUTOX_MODE && Autox_found)
widths_resize();
// deal with potential signal(s) since the last time around...
/* deal with potential signal(s) since the last time around
plus any input which may change 'tasks_refresh' needs... */
if (Frames_signal)
zap_fieldstab();
// whoa either first time or thread/task mode change, (re)prime the pump...
if (Pseudo_row == PROC_XTRA) {
#ifdef THREADED_TSK
sem_post(&Semaphore_tasks_beg);
sem_wait(&Semaphore_tasks_end);
#else
tasks_refresh(NULL);
#endif
usleep(LIB_USLEEP);
putp(Cap_clr_scr);
} else
putp(Batch ? "\n\n" : Cap_home);
#ifdef THREADED_TSK
sem_post(&Semaphore_tasks_beg);
#else
@ -6393,6 +6377,23 @@ static void frame_make (void) {
memory_refresh(NULL);
#endif
// check auto-sized width increases from the last iteration...
if (AUTOX_MODE && Autox_found)
widths_resize();
// whoa either first time or thread/task mode change, (re)prime the pump...
if (Pseudo_row == PROC_XTRA) {
usleep(LIB_USLEEP);
#ifdef THREADED_TSK
sem_wait(&Semaphore_tasks_end);
sem_post(&Semaphore_tasks_beg);
#else
tasks_refresh(NULL);
#endif
putp(Cap_clr_scr);
} else
putp(Batch ? "\n\n" : Cap_home);
Tree_idx = Pseudo_row = Msg_row = scrlins = 0;
summary_show();
Max_lines = (Screen_rows - Msg_row) - 1;