I'm trying to process large csv data as it comes in chunk. If I run chunkprocess without threading, the application doesn't crash. However, as soon as I add in the threadpool, the application crashes and throws in the following errors. ChunkProcess run only emits (nothing else yet) signal shared_ptr which is a private member of ChunkProcess. After reading articles online, I found that shared_ptr is not thread safe unless you make a copy of it... so is there a way i can make a copy of it while using it as a signal?
SELECT
List,of,columns,that,will,form,row,headers,
List,of,row,values,that,form,column,headers
FROM (
select query that pulls ONLY the data you need for
row headers, column headers, and the columns you want to summarise
)tablealias
PIVOT
(
SUM/AVG/MIN/MAX/etc(column to summarise)
FOR category IN (List,of,row,values,that,form,column,headers)
) AS pvt;
void SwapRightMostNBits(unsigned int& a, unsigned int& b, unsigned int n){
unsigned int mask=(1U<<n) -1;
unsigned int diff = (a^b) & mask;
a ^= diff;
b ^= diff;
}
答案 0 :(得分:1)
ASSERT: "!d->ref.isShared()" in file tools\qlist.cpp, line 162
这意味着QListData
(QList的私有部分)中的断言失败。这与shared_ptr
无关。
Qt source并未澄清此断言所检查的内容,但我猜测您在QList
上做了非法行为,或者您有某种竞争条件。
由于您没有显示相关的代码部分,因此很难说清楚。
QObject::~QObject: Timers cannot be stopped from another thread
这意味着您的QObject
(最可能是ChunkProcessor
)会从另一个线程中销毁,并且此对象有一个活动的计时器正在运行。
假设这是ChunkProcessor
的问题,您可以通过以下几种方式解决问题:
ChunkProcessor
的所有权转移到广告资源池(ChunkProcessor
应该返回autoDelete()
)注意崩溃与false
无关!
还有问题是您注册shared_ptr
作为类型吗?
如果您没有通过信号槽机制(因为您使用了自动连接类型),那么它就没有了!