社区
进程/线程/DLL
帖子详情
多线程时资源已经加锁,为什么还会出现The process cannot access the file because it is being used by another process
unicode
2007-12-27 11:18:02
如上,大概有什么原因导致,能不能知道是访问哪个资源时出错的?因为一个thread要访问很多资源
...全文
498
3
打赏
收藏
多线程时资源已经加锁,为什么还会出现The process cannot access the file because it is being used by another process
如上,大概有什么原因导致,能不能知道是访问哪个资源时出错的?因为一个thread要访问很多资源
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
forwtl
2007-12-27
打赏
举报
回复
那就是你的临界代码没写好。
能不能知道是访问哪个文件时出错的
自已debug呀。
unicode
2007-12-27
打赏
举报
回复
看信息是和线程无关,可是这个错误就是在我把程序改成多线程后才出现的,本来运行好好的。
请问,能不能知道是访问哪个文件时出错的??
forwtl
2007-12-27
打赏
举报
回复
The process cannot access the file because it is being used by another process
和线程无关。
你要操作的那个file,如果你是独占打开(file已被已外的进程独占或共享打开),肯定出错。
你要操作的那个file,如果你是共享打开(file已被已外的进程独占打开),肯定出错。
如果都是共享打开且已打开,可能你要操作file时,该 file 被另一个进程(暂时或永久) lockfile 了。
如何用StreamReader打开被其他进程占用的文件
用StreamReader打开被其他进程占用的文件
时
,会收到The
process
cannot
access
the
file
'xxxxx' because it is being u
sed
by another
process
.的错误信息。 采用下面的方式可以解决这个问题: using(
File
Stream fs = new
File
Stream(@"xxx",
File
Mode.Ope
.net core 监听文件夹变化,
File
SystemWatcher 封装
File
Watch 功能 .net core 监听文件夹变化,
File
SystemWatcher 封装 问题:Copy一个新文件能正常运行,但是Copy第二个文件的
时
候就报一个文件正被其他线程占用无法打开的异常?The
process
cannot
access
the
file
‘z :\TF_B1BBA.xml’ because it is being u
sed
by another
process
?
File
SystemWatcher有个问题,就是当新文件到达了以后,Watcher太灵敏,文件到达了
WorkManager 流程分析和源码解析 | 开发者说·DTalk
本文原作者:狐友技术团队,原文发布于: 搜狐技术产品https://mp.weixin.qq.com/s/KlzYHqd3RhF1D8dDAYiSjA前言WorkManager 统一了...
CPT104 Operating System Concepts Note
CPT104 Notes Lecture 1
Process
What is an Operating System? OS An Operating system is the heart of computers, mobiles and other computing devices that helps operate the hardware and software. 6 Layers: 0.hardware 1. CPU scheduling 2.Memory management 3.
ACE TAO Programming Chapter 12. 基本
多线程
编程 (Basic Multithreaded Programming)
<!-- [endif]--> Chapter12. 基本
多线程
编程 (Basic Multithreaded Programming ) 12.1 开始 Getting Started By default, a
process
is created with a single thread, which we call the main thread. This thr...
进程/线程/DLL
15,471
社区成员
49,182
社区内容
发帖
与我相关
我的任务
进程/线程/DLL
VC/MFC 进程/线程/DLL
复制链接
扫一扫
分享
社区描述
VC/MFC 进程/线程/DLL
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章