Opened 13 months ago

Closed 2 months ago

#5179 closed change (fixed)

Implement asynchronous executor with a controllable lifetime.

Reported by: sergz Assignee: sergz
Priority: P2 Milestone:
Module: Libadblockplus Keywords:
Cc: fhd, asmirnov Blocked By:
Blocking: #3595, #5180, #5183 Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29706560/

Description

Background

We run some operations in an asynchronous manner in background threads and the current approach with detached threads causes very bad effects. In particular it is a source of numerous race conditions. Therefore we need an option to wait for all currently running operations.

What to change

Such executor is implemented in https://codereview.adblockplus.org/29367507/, however the change set contains too much changes, so one can fine the SSCCE at https://gist.github.com/abby-sergz/12a2c1d25fc93c17838c878a11d7fe89.

Change History (9)

comment:1 Changed 13 months ago by sergz

  • Blocking 5180 added

comment:2 Changed 13 months ago by sergz

  • Blocking 5182 added

comment:3 Changed 13 months ago by sergz

  • Blocking 5183 added

comment:4 Changed 13 months ago by sergz

  • Blocking 5182 removed

comment:5 Changed 10 months ago by sergz

  • Blocking 3595 added

comment:6 Changed 3 months ago by sergz

  • Cc asmirnov added
  • Owner set to sergz

A recent case (#6365) has shown that now it's going to be important, therefore IMO it's time to finish all threading issues.

@asmirnov: when the patch is landed it can break tests of libadblockplus-android because the engine will wait for all currently running operations, and if there is at least one infinite loop then the test will never finish. Could please check it and create corresponding libadblockplus-android issues.

comment:7 Changed 3 months ago by sergz

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:8 Changed 2 months ago by abpbot

comment:9 Changed 2 months ago by sergz

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.