|
[求助]多线程的数据怎么同步?
没人回复,貌似要用队列 |
|
[求助]多线程的数据怎么同步?
我写了一个简单的模拟器 密码是kanxue 有兴趣的去研究下 两个代码的差别就一行 if (shiwuc.m=0) and (shiwuc.c=0) then //两个都消费完才开始生产 就没冲突 但是如果两个都消费完这样无效率 因为A要等B B要等A浪费了时间(两个都要消费完嘛,A消费好了 还要等B消费完才能 继续 B也是一样) if shiwuc.c=0 then //这里C消费消费完毕之后 (shiwuc.m 这个数据顺利的给A线程消费让A消费完)同时B线程 重新生产 让B消费掉 shiwuc.c 但是象我这么写 会产生冲突 问题就是如何解决这个冲突(B消费完了 重新产生了 shiwuc.m 把原先的数据shiwuc.m 覆盖了 需要把原先的数据保存起来 让A消费完的 B此时可以消费新的shiwuc.c 并且 把shiwuc.m 数据保存起来等A消费完 )大家看完程序之后就知道了 主要是怎么修改成 (if shiwuc.c=0 then ) 这样 而且两个线程不冲突 A线程可以顺利的消费完之前没消费的,解决冲突问题 |
|
|
|
[求助]悲催的delphi xe3 中文变量定义中的一个BUG
[QUOTE=mudropmu;1185203] 中文也没有问题呀。你的代码没有改的。直接编译出来和调式模中效果一样的呀。[/QUOTE] 你确定是一样的???/这个就太。。。 |
|
[求助]悲催的delphi xe3 中文变量定义中的一个BUG
[QUOTE=mudropmu;1185211] 又试了一下 D14 也是正常的呀。没问题的。 u字符处理 d2009基本上都正常的。[/QUOTE] 你这个版本的下载地址 感谢,我想知道是不是我下的版本也有问题 |
|
[求助]悲催的delphi xe3 中文变量定义中的一个BUG
不是权限问题 是编译器认得中文,但是很吃力,而且有时候认错了,毕竟他是个老外 前面的朋友一修改英文的 就又可以了 还有 支持宽字符这个牛皮xe 3真吹破了 虽然在一般情况下 中文变量中文函数一起上都可以 但是我这个就不可以了 |
|
[求助]悲催的delphi xe3 中文变量定义中的一个BUG
把你的xe3的下载地址发下。还有你把变量名修改了。。。。 我本来就是想变成中文的变量名。。。 不可能是什么杀软问题 你只修改地址 不修改那些变量名 根本运行错误的 你把名字都改了 还说没修改。。诶 本来 我要讨论的就是 那变量名 程序本身是没什么问题的 读点数据什么的 压根就入门水平 首先一点,你用中文做变量名,做函数名,本身就是严重的错误。不管它支不支持,你都不能这样弄,这不是易语言的。--------------------为什么不可以这么弄,本来就是想知道这个路子可不可以走通撒。还有 这个本来就不是易语言,只是他支持中文变量名和函数名 我想再强调一遍 在普通程序 是可以的 但是在这个程序下不可以。好象是涉及到中文变量 的指针什么的 还有我自己定义的数组有点多。 如果无法支持中文做变量名函数名。 他所谓的新特性 所谓支持宽字符难道不是摆设 和虚假宣传么?他可以做到的只是简单的支持这些功能一旦涉及到复杂的,就不行了。 我本身是想知道 如果 用中文变量和中文函数 他是否可以执行, ---------------------总之是你没明白我的意思 程序变量名被你修改了 中文变英文了 当然可以运行了 在一般的情况 不是很特殊的情况下 中文函数中文变量一起上都不会有错 这个我测试过 只有在某些特殊情况下 才出现 我所说的情况 你做的修改 根本就是不知道我在做什么测试。 |
|
[求助]悲催的delphi xe3 中文变量定义中的一个BUG
之前我也测试过其他的程序 貌似都没什么问题,而且去掉很多自定义的数组也没问题,这个BUG是在某些条件下才激活的,深入研究就知道了,不过我没那么多时间跟编译器过不去 |
|
|
|
[求助]悲催的delphi xe3 中文变量定义中的一个BUG
delphi 2009还是2010之后支持 unicode定义变量名也就是什么文的变量名都可以只要是unicode型就可以。。 |
|
[求助]悲催的delphi xe3 中文变量定义中的一个BUG
随便找计算器测试挖,本来就是做例子说明问题的 |
|
[求助]悲催的delphi xe3 中文变量定义中的一个BUG
这个问题我遇到过了 也解决了,你的意思是要提升权限么? 但是我有一个程序提升权限了 依然一样 而且是XP下的 win7的下话因为获得OpenProcess最大权限是比较麻烦的 所以可以申请一个句柄复制权限 然后通过DuplicateHandle 复制句柄把一个小权限的弄到最大权限 这样就可以用那个权限来读写了 我跟踪了下 这个问题不存在的 XP下 本身是提权方便的 还有如果把那些 自定义的数组什么的清理干净了 就又可以打开了。。 这个调戏人啊 |
|
|
|
[求助]悲催的delphi xe3 中文变量定义中的一个BUG
没人关注了。。。 |
|
|
|
[求助]悲催的delphi xe3 中文变量定义中的一个BUG
看来没什么人关注了。。 |
|
[求助]悲催的delphi xe3 中文变量定义中的一个BUG
这个也太代价了吧。而且如果是编译器的设计问题的话,错误估计还是一样的 这个代码在XE2 和2010下应该没什么大问题吧。你用这两个打开看看。 我这里安装的太多了 D7和 XE盘只有 c d e互相干扰就麻烦了。 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值