|
190 | 190 | #define STEM_LAZY (0L)
|
191 | 191 | #endif
|
192 | 192 |
|
| 193 | +#define STEM_SHUTDOWN_SEQ (ULONG_MAX-1UL) |
| 194 | + |
193 | 195 | static inline void
|
194 | 196 | STEM_(in_update)( fd_stem_tile_in_t * in ) {
|
195 | 197 | fd_fseq_update( in->fseq, in->seq );
|
@@ -431,6 +433,10 @@ STEM_(run1)( ulong in_cnt,
|
431 | 433 | ulong out_idx = cons_out[ cons_idx ];
|
432 | 434 | ulong cons_cr_avail = (ulong)fd_long_max( (long)out_depth[ out_idx ]-fd_long_max( fd_seq_diff( out_seq[ out_idx ], cons_seq[ cons_idx ] ), 0L ), 0L );
|
433 | 435 |
|
| 436 | + /* If a reliable consumer exits, they can set the credit |
| 437 | + return fseq to STEM_SHUTDOWN_SEQ to indicate they are no |
| 438 | + longer actively consuming. */ |
| 439 | + cons_cr_avail = fd_ulong_if( cons_seq[ cons_idx ]==STEM_SHUTDOWN_SEQ, out_depth[ out_idx ], cons_cr_avail ); |
434 | 440 | slowest_cons = fd_ulong_if( cons_cr_avail<min_cr_avail, cons_idx, slowest_cons );
|
435 | 441 |
|
436 | 442 | cr_avail[ out_idx ] = fd_ulong_min( cr_avail[ out_idx ], cons_cr_avail );
|
@@ -783,7 +789,7 @@ STEM_(run)( fd_topo_t * topo,
|
783 | 789 | ulong fseq_id = tile->in_link_fseq_obj_id[ i ];
|
784 | 790 | ulong * fseq = fd_fseq_join( fd_topo_obj_laddr( topo, fseq_id ) );
|
785 | 791 | FD_TEST( fseq );
|
786 |
| - fd_fseq_update( fseq, ULONG_MAX ); |
| 792 | + fd_fseq_update( fseq, STEM_SHUTDOWN_SEQ ); |
787 | 793 | }
|
788 | 794 | }
|
789 | 795 | }
|
|
0 commit comments