Boost.Thread线程不会在iPhone / iPad的首发在发布版本 [英] Boost.Thread threads not starting on the iPhone/iPad in release builds

查看:78
本文介绍了Boost.Thread线程不会在iPhone / iPad的首发在发布版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在写一个iPad应用程序与相当多的背景处理所有这一切都写在了一组C ++库。这些库做工精细在Linux,Mac和Windows,但在iPad上他们只在调试工作的基础之上。

We're writing an iPad app with quite a lot of background processing all of which is written in a set of C++ libraries. These libraries work fine on Linux, Mac and Windows but on the iPad they only work in debug builds.

在发布版本,它看起来像当第一个子线程正在加速旋转,要么从来没有真正启动,或者它不会在其加工得到远远不足以让主线程继续(是不是很从调试明显,如果线程实际上是启动或没有因使用断点在发布版本)的正常问题。

In release builds, it looks like when the first sub-thread is being spun up it either never actually starts, or it doesn't get far enough in its processing to allow the main thread to continue (it isn't very obvious from the debugger if the thread is actually starting or not due to the normal problem of using break points in release builds).

展望code>在的boost ::详细:: ::用spin_lock锁)。

CPU没有达到100%,因此不会出现该旋转锁定挨饿新线程的创建。

The CPU isn't at 100% so it doesn't appear that the spin lock is starving the creation of the new thread.

我们都试过提升1.42和1.44提升,并且他们的行为方式相同。双方的iOS 3.2和4.2都失败与发布版本。

We've tried both Boost 1.42 and Boost 1.44 and they both behave the same way. Both iOS 3.2 and 4.2 both fail with release builds.

什么是我们可能做错了,或者这是一个已知不工作的配置?

What are we likely doing wrong, or is this a known not-working configuration?

推荐答案

我们现在已经制定了这一点。问题是,在构建选项和线索是,它是那些失败的自旋锁。

We've now worked this out. The problem is in the build options, and the clue is that it is the spin locks that are failing.

原来是有其在非拇指建立使用自旋锁的ARM实现。因为拇指版本是做的方式是非常容易搭配拇指和非拇指构建(即,建立加速无拇指和包含X code建立与拇指)。这是我们在做什么,这意味着自旋锁将永远不会发出信号,将只是永远阻塞。

It turns out that there is an ARM implementation of the spin lock which is used in non-thumb builds. Because of the way that the thumb builds are done it is very easy to mix thumb and non-thumb builds (i.e., build Boost without thumb and have xCode build with thumb). This is what we were doing, and this means that the spin lock will never get signalled and will just block forever.

因此,要解决这个问题,请确保您使用的是相同的拇指编译选项您所有库!

这线程讨论的问题:<一href=\"http://groups.google.com/group/boost-list/browse_thread/thread/7dc1e80659182ab3\">http://groups.google.com/group/boost-list/browse_thread/thread/7dc1e80659182ab3

这篇关于Boost.Thread线程不会在iPhone / iPad的首发在发布版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆