Shorten to one epoch per PDU

A full read cycle can take a very long time if the limits are set too
high.
This commit is contained in:
Ondřej Kuzník 2018-10-18 15:49:43 +01:00
parent b49f51879f
commit b2e57148fa
2 changed files with 6 additions and 0 deletions

View File

@ -128,6 +128,11 @@ handle_pdus( void *ctx, void *arg )
}
break;
}
assert( IS_ALIVE( c, c_refcnt ) );
epoch_leave( epoch );
epoch = epoch_join();
assert( IS_ALIVE( c, c_refcnt ) );
}
event_add( c->c_read_event, c->c_read_timeout );

View File

@ -132,6 +132,7 @@ int try_release_ref( uintptr_t *refp, void *object, dispose_cb *cb );
*/
#define RELEASE_REF( object, ref_field, cb ) \
do { \
assert( IS_ALIVE( (object), ref_field ) ); \
if ( !__atomic_sub_fetch( \
&(object)->ref_field, 1, __ATOMIC_ACQ_REL ) ) { \
epoch_append( object, (dispose_cb *)cb ); \