i7处理器和windows8操作系统上的多线程问题
MultiThreading issue on i7 processor with windows8 os
我运行的应用程序有两个线程。一个线程保存从相机抓取的图像,另一个线程处理这些图像,这里的问题是,处理线程在处理过程中停止(停滞或被阻止无法获取)几个小时后(每次运行时随机),但它在带有windows7的i3上以及在带有windowsXp的双核处理器上都能正常工作。两个线程中都没有关键节或锁。请帮我解决这个问题。
来自线程2:的代码
fn_Waitforfiles(); // while loop waits until the 4 images saved in watch folder if not it will return at count of 50
CString strLog = "";
strLog.Format("Entering Skipping..");
for(int d = 1; d <= m_iInterLeave; d++)
{
m_ifileCount++;
m_strcurFilePath.Format("%s\%lu.jpeg", m_strToProcessDir, m_ifileCount);
if(PathFileExists(m_strcurFilePath))
::DeleteFile(m_strcurFilePath);
else
{
m_ifileCount--;
m_strcurFilePath.Format("%s\%lu.jpeg", m_strToProcessDir, m_ifileCount);
}
if(d == m_iInterLeave)
{
m_ifileCount++;
m_strcurFilePath.Format("%s\%lu.jpeg", m_strToProcessDir, m_ifileCount);
}
}
strLog = "";
strLog.Format("Skipped %d images on Interleaving..", m_iInterLeave);
MSSLOGGER::WriteLog(_T(strLog));
在写入日志"Enter Skiping.."后,thread2不再运行
线索可能在"查看文件夹中的图像"中。这听起来像是你依赖于文件更改通知,而这些通知可能会被错过(更准确地说,其中一些通知可能会折叠成一个摘要通知)。
相关文章:
- 尝试从头开始实现Leetcode的FizzBuzz多线程问题。收到"libc++abi.dylib: terminating"错误
- 在多线程函数中返回共享的常量指针会导致计时问题吗?
- C++多线程生产者-消费者问题
- C++ 多线程中的锁和条件变量问题
- 多线程与线程小问题
- 多线程概念问题
- 在 Linux 中从单独的单线程进程生成多线程进程时出现问题
- 如何解决多线程绘图的问题不流畅
- C++ std::endl 的多线程程序 I/O 问题
- 我遇到了一个关于多线程的小问题.需要多线程来计算 Pi 和方差
- gdal多线程问题
- C++11 多线程问题
- boost::d ynamic_bitset 多线程问题
- Android 的 c++11 多线程问题,其中某些线程未正确调度
- i7处理器和windows8操作系统上的多线程问题
- Poco::ServerApplication的多线程问题
- New和delete处理多线程问题
- 如何在c++中避免多线程问题(wxWidgets和Cplex)
- C++多线程问题
- Libcurl发送/接收多线程问题