How to find out what mach_msg_trap waits for?

后端 未结 2 1190
时光取名叫无心
时光取名叫无心 2020-12-25 11:21

I a profiling my iPhone application on target, and according to Instruments 65% of the time is spent in mach_msg_trap.

I have a background thread that r

2条回答
  •  旧巷少年郎
    2020-12-25 11:36

    If you're not expecting your main thread to be doing anything other than waiting on this background thread (or waiting for user input) there's nothing to be concerned about -- your application simply has nothing to do most of the time.

    If you're expecting the main thread to be actively doing something else, please update your question to describe that. In this case, you might want to look at the full call stacks to mach_msg_trap as it's often at the bottom of a call stack where the actual time-waster is further up.

提交回复
热议问题