我参与设计的一个android多线程框架,用于SAP customer briefing

124 阅读1分钟

for simplify reason I only list three carousel item ( News, Opportunity and Business History ).

UI thead will start thread1, 2 and 3 simultaneously
For thread 1, 2 and 3: once they finish, they will trigger corresponding call back listener implemented in UI thread;
for listener designed for thread1, it will start three new thread simultaneously: thread 4 , 5 and 6.
Let’s define “a > b“ means a happens earlier than b:
Regarding sequence, we can only ensure that a > b, b > c, b > d, b > e,
we can NOT ensure the sequence among c, d, e, f, g

clipboard1

So if we use standard Android performance library, you will find that start and stop performance interaction step are not sequentially matched as “Start1, end1, start2, end2, start3, end3…“.

clipboard2

As confirmed by Stephan, our case is not supported by library. So we have implemented our own logic to record performance.

clipboard3

要获取更多Jerry的原创文章,请关注公众号"汪子熙":
公众号截图