LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: hoho_zhao

昏晕几天!!!while(1)线程被莫名杀死!或阻塞!呜呜。。。

[复制链接]
 楼主| 发表于 2006-11-10 22:15:09 | 显示全部楼层
以下是开头一些部分,有几个关于interrupt的输出



input = -1
this is the start of the while(1) loop:  loop iitiitittittittitiitiitittitiitit5input = -1
this is the start of the while(1) loop:  loop 2897
input = -1
this is the start of the while(1) loop:  loop 2898
input = -1
this is the start of the while(1) loop:  loop 2899
input = -1
this is the start of the while(1) loop:  loop 2900
input = -1
this is the start of the while(1) loop:  loop 2901
input = -1
this is the start of the while(1) loop:  loop 2902
input = -1
this is the start of the while(1) loop:  loop 2903
input = -1
this is the start of the while(1) loop:  loop 2904
input = -1
this is the start of the while(1) loop:  loop 2905
input = -1
this is the start of the while(1) loop:  loop 2906
input = -1
this is the start of the while(1) loop:  loop 2907
input = -1
this is the start of the while(1) loop:  loop 2908
input = -1
this is the start of the while(1) loop:  loop ttiitittittittittittittitiitiitii6this is thethis is the start of the while(1) loop:  loop 3282
input = -1
this is the start of the while(1) loop:  loop 3283
input = -1
this is the start of the while(1) loop:  loop 3284
input = -1
this is the start of the while(1) loop:  loop 3285
input = -1
this is the start of the while(1) loop:  loop 3286
input = -1
this is the start of the while(1) loop:  loop 3287
input = -1
this is the start of the while(1) loop:  loop 3288
input = -1
this is the start of the while(1) loop:  loop 3289
input = -1
this is the start of the while(1) loop:  loop 3290
input = -1
this is the start of the while(1) loop:  loop 3291
input = -1
this is the start of the while(1) loop:  loop 3292
input = -1
this is the start of the while(1) loop:  loop 3293
input = -1
this is the start of the while(1) loop:  loiitiitiitiitiitittitiitiitittittitii7input = -1
this is the start of the while(1) loop:  loop 3673
input = -1
this is the start of the while(1) loop:  loop 3674
input = -1
this is the start of the while(1) loop:  loop 3675
input = -1
this is the start of the while(1) loop:  loop 3676
input = -1
this is the start of the while(1) loop:  loop 3677
input = -1
this is the start of the while(1) loop:  loop 3678
input = -1
this is the start of the while(1) loop:  loop 3679
input = -1
this is the start of the while(1) loop:  loop 3680
input = -1
this is the start of the while(1) loop:  loop 3681
input = -1
this is the start of the while(1) loop:  loop 3682
input = -1
this is the start of the while(1) loop:  loop 3683
input = -1
this is the start of the while(1) loop:  loop 3684
input = -1
this is the start of the while(1) loop:  loop tittittittittitiitiitittittititti8this is the start of the while(1) loop:  loop 4056
input = -1
this is the start of the while(1) loop:  loop 4057
input = -1
this is the start of the while(1) loop:  loop 4058
input = -1
this is the start of the while(1) loop:  loop 4059
input = -1
this is the start of the while(1) loop:  loop 4060
input = -1
this is the start of the while(1) loop:  loop 4061
input = -1
this is the start of the while(1) loop:  loop 4062
input = -1
this is the start of the while(1) loop:  loop 4063
input = -1
this is the start of the while(1) loop:  loop 4064
input = -1
this is the start of the while(1) loop:  loop 4065
input = -1
this is the start of the while(1) loop:  loop 4066
input = -1
this is the start of the while(1) loop:  loop 4067
input = -1
this is the start of the while(1) loop:  loop 4068
input = ttitiitiitiitittittitiitiitittitiitittitiitithtttiitiitiitiitiitiitiiti9this is the start of the while(1) loop:  loop 4440
input = -1
this is the start of the while(1) loop:  loop 4441
input = -1
this is the start of the while(1) loop:  loop 4442
input = -1
this is the start of the while(1) loop:  loop 4443
input = -1
this is the start of the while(1) loop:  loop 4444
input = -1
this is the start of the while(1) loop:  loop 4445
input = -1
this is the start of the while(1) loop:  loop 4446
input = -1
this is the start of the while(1) loop:  loop 4447
input = -1
this is the start of the while(1) loop:  loop 4448
input = -1
this is the start of the while(1) loop:  loop 4449
input = -1
this is the start of the while(1) loop:  loop 4450
input = -1
this is the start of the while(1) loop:  loop 4451
input = -1
this is the start of the while(1) loop:  loop 4452
input =tittiitiitiitiitiitiitittittitiitittitittittitiitttiittittiitiitiitiitii0-1
this is the start of the while(1) loop:  loop 4823
input = -1
this is the start of the while(1) loop:  loop 4824
input = -1
this is the start of the while(1) loop:  loop 4825
input = -1
this is the start of the while(1) loop:  loop 4826
input = -1
this is the start of the while(1) loop:  loop 4827
input = -1
this is the start of the while(1) loop:  loop 4828
input = -1
this is the start of the while(1) loop:  loop 4829
input = -1
this is the start of the while(1) loop:  loop 4830
input = -1
this is the start of the while(1) loop:  loop 4831
input = -1
this is the start of the while(1) loop:  loop 4832
input = -1
this is the start of the while(1) loop:  loop 4833
input = -1
this is the start of the while(1) loop:  loop 4834
input = -1
this is the start of the while(1) loop:  loop 4835iittiittittittittittittitiiti1input = -1
this is the start of the while(1) loop:  loop 5209
input = -1
this is the start of the while(1) loop:  loop 5210
input = -1
this is the start of the while(1) loop:  loop 5211
input = -1
this is the start of the while(1) loop:  loop 5212
input = -1
this is the start of the while(1) loop:  loop 5213
input = -1
this is the start of the while(1) loop:  loop 5214
input = -1
this is the start of the while(1) loop:  loop 5215
input = -1
this is the start of the while(1) loop:  loop 5216
input = -1
this is the start of the while(1) loop:  loop 5217
input = -1
this is the start of the while(1) loop:  loop 5218
input = -1
this is the start of the while(1) loop:  loop 5219
input = -1
this is the start of the while(1) loop:  loop 5220
input = -1
this is the start of the while(1) loop:  loop tiittittittittittitittittitittitt2his is the end of the interrupt_handler: loop 12

input = -1
this is the start of the while(1) loop:  loop 5592
input = -1
this is the start of the while(1) loop:  loop 5593
input = -1
this is the start of the while(1) loop:  loop 5594
input = -1
this is the start of the while(1) loop:  loop 5595
input = -1
this is the start of the while(1) loop:  loop 5596
input = -1
this is the start of the while(1) loop:  loop 5597
input = -1
this is the start of the while(1) loop:  loop 5598
input = -1
this is the start of the while(1) loop:  loop 5599
input = -1
this is the start of the while(1) loop:  loop 5600
input = -1
this is the start of the while(1) loop:  loop 5601
input = -1
this is the start of the while(1) loop:  loop 5602
input = -1
this is the start of the while(1) loop:  loop 5603
inputttittitiitittittitiitittitiitittitiitittitiitithtiiittiittiittiittittiitii3his is thethis is the start of the while(1) loop:  loop 5975
input = -1
this is the start of the while(1) loop:  loop 5976
input = -1
this is the start of the while(1) loop:  loop 5977
input = -1
this is the start of the while(1) loop:  loop 5978
input = -1
this is the start of the while(1) loop:  loop 5979
input = -1
this is the start of the while(1) loop:  loop 5980
input = -1
this is the start of the while(1) loop:  loop 5981
input = -1
this is the start of the while(1) loop:  loop 5982
input = -1
this is the start of the while(1) loop:  loop 5983
input = -1
this is the start of the while(1) loop:  loop 5984
input = -1
this is the start of the while(1) loop:  loop 5985
input = -1
this is the start of the while(1) loop:  loop 5986
input = -1
this is the start of the while(1) loop:  loop ttittittitittitiitittittittitiiti4this is the end of the interrupt_handler: loop 14

input = -1
this is the start of the while(1) loop:  loop 6362
input = -1
this is the start of the while(1) loop:  loop 6363
input = -1
this is the start of the while(1) loop:  loop 6364
input = -1
this is the start of the while(1) loop:  loop 6365
input = -1
this is the start of the while(1) loop:  loop 6366
input = -1
this is the start of the while(1) loop:  loop 6367
input = -1
this is the start of the while(1) loop:  loop 6368
input = -1
this is the start of the while(1) loop:  loop 6369
input = -1
this is the start of the while(1) loop:  loop 6370
input = -1
this is the start of the while(1) loop:  loop 6371
input = -1
this is the start of the while(1) loop:  loop 6372
input = -1
this is the start of the while(1) loop:  loop 6373
itiitiitittittittitiitittittittitiitittittittitittiniiiittiitiitittitiitittitii5his is thethis is the start of the while(1) loop:  loop 6751
input = -1
this is the start of the while(1) loop:  loop 6752
input = -1
this is the start of the while(1) loop:  loop 6753
input = -1
this is the start of the while(1) loop:  loop 6754
input = -1
this is the start of the while(1) loop:  loop 6755
input = -1
this is the start of the while(1) loop:  loop 6756
input = -1
this is the start of the while(1) loop:  loop 6757
input = -1
this is the start of the while(1) loop:  loop 6758
input = -1
this is the start of the while(1) loop:  loop 6759
input = -1
this is the start of the while(1) loop:  loop 6760
input = -1
this is the start of the while(1) loop:  loop 6761
input = -1
this is the start of the while(1) loop:  loop 6762
input = -1
this is the start of the while(1) loop:  loopittittiittitittittitiitittitiititt6this is the end of the interrupt_handler: loop 16

input = -1
this is the start of the while(1) loop:  loop 7138
input = -1
this is the start of the while(1) loop:  loop 7139
input = -1
this is the start of the while(1) loop:  loop 7140
input = -1
this is the start of the while(1) loop:  loop 7141
input = -1
this is the start of the while(1) loop:  loop 7142
input = -1
this is the start of the while(1) loop:  loop 7143
input = -1
this is the start of the while(1) loop:  loop 7144
input = -1
this is the start of the while(1) loop:  loop 7145
input = -1
this is the start of the while(1) loop:  loop 7146
input = -1
this is the start of the while(1) loop:  loop 7147
input = -1
this is the start of the while(1) loop:  loop 7148
input = -1
this is the start of the while(1) loop:  loop 7149
input ittittittittitiitiitiitittitiitittitiitittitiniiiiittiittittitiitittitiit7his is the end of the interrupt_handler: loop 17

input = -1
this is the start of the while(1) loop:  loop 7520
input = -1
this is the start of the while(1) loop:  loop 7521
input = -1
this is the start of the while(1) loop:  loop 7522
input = -1
this is the start of the while(1) loop:  loop 7523
input = -1
this is the start of the while(1) loop:  loop 7524
input = -1
this is the start of the while(1) loop:  loop 7525
input = -1
this is the start of the while(1) loop:  loop 7526
input = -1
this is the start of the while(1) loop:  loop 7527
input = -1
this is the start of the while(1) loop:  loop 7528
input = -1
this is the start of the while(1) loop:  loop 7529
input = -1
this is the start of the while(1) loop:  loop 7530
input = -1
this is the start of the while(1) loop:  loop 7531
inputiittittittitiitiitittitiitiitiitittitittittititiiiittiittittittittittittit8this is the start of the while(1) loop:  loop 7904
input = -1
this is the start of the while(1) loop:  loop 7905
input = -1
this is the start of the while(1) loop:  loop 7906
input = -1
this is the start of the while(1) loop:  loop 7907
input = -1
this is the start of the while(1) loop:  loop 7908
input = -1
this is the start of the while(1) loop:  loop 7909
input = -1
this is the start of the while(1) loop:  loop 7910
input = -1
this is the start of the while(1) loop:  loop 7911
input = -1
this is the start of the while(1) loop:  loop 7912
input = -1
this is the start of the while(1) loop:  loop 7913
input = -1
this is the start of the while(1) loop:  loop 7914
input = -1
this is the start of the while(1) loop:  loop 7915
input = -1
this is the start of the while(1) loop:  loop 7916
iiittiittittiitiittitiitittitiitittitiitittitiitittintiiiitttiittiitiitiitiitii98291
input = -1
this is the start of the while(1) loop:  loop 8292
input = -1
this is the start of the while(1) loop:  loop 8293
input = -1
this is the start of the while(1) loop:  loop 8294
input = -1
this is the start of the while(1) loop:  loop 8295
input = -1
this is the start of the while(1) loop:  loop 8296
input = -1
this is the start of the while(1) loop:  loop 8297
input = -1
this is the start of the while(1) loop:  loop 8298
input = -1
this is the start of the while(1) loop:  loop 8299
input = -1
this is the start of the while(1) loop:  loop 8300
input = -1
this is the start of the while(1) loop:  loop 8301
input = -1
this is the start of the while(1) loop:  loop 8302
input = -1
this is the start of the while(1) loop:  loop 8303
input = -1
this is the start of the while(1) loop: ttiitiitiitiitittittitiitiitittittitiit0this is the start of the while(1) loop:  loop 8674
input = -1
this is the start of the while(1) loop:  loop 8675
input = -1
this is the start of the while(1) loop:  loop 8676
input = -1
this is the start of the while(1) loop:  loop 8677
input = -1
this is the start of the while(1) loop:  loop 8678
input = -1
this is the start of the while(1) loop:  loop 8679
input = -1
this is the start of the while(1) loop:  loop 8680
input = -1
this is the start of the while(1) loop:  loop 8681
input = -1
this is the start of the while(1) loop:  loop 8682
input = -1
this is the start of the while(1) loop:  loop 8683
input = -1
this is the start of the while(1) loop:  loop 8684
input = -1
this is the start of the while(1) loop:  loop 8685
input = -1
this is the start of the while(1) loop:  loop 8686
input =tiitiitiitittitiitittitiitittitiitittitiitittitttiittittittittittittitti1his is thethis is the start of the while(1) loop:  loop 9059
input = -1
this is the start of the while(1) loop:  loop 9060
input = -1
this is the start of the while(1) loop:  loop 9061
input = -1
this is the start of the while(1) loop:  loop 9062
input = -1
this is the start of the while(1) loop:  loop 9063
input = -1
this is the start of the while(1) loop:  loop 9064
input = -1
this is the start of the while(1) loop:  loop 9065
input = -1
this is the start of the while(1) loop:  loop 9066
input = -1
this is the start of the while(1) loop:  loop 9067
input = -1
this is the start of the while(1) loop:  loop 9068
input = -1
this is the start of the while(1) loop:  loop 9069
input = -1
this is the start of the while(1) loop:  loop 9070
input = -1
this is the start of the while(1) loop:  loop 9tittiittittittittitiitittitiitit2input = -1
this is the start of the while(1) loop:  loop 9445
input = -1
this is the start of the while(1) loop:  loop 9446
input = -1
this is the start of the while(1) loop:  loop 9447
input = -1
this is the start of the while(1) loop:  loop 9448
input = -1
this is the start of the while(1) loop:  loop 9449
input = -1
this is the start of the while(1) loop:  loop 9450
input = -1
this is the start of the while(1) loop:  loop 9451
input = -1
this is the start of the while(1) loop:  loop 9452
input = -1
this is the start of the while(1) loop:  loop 9453
input = -1
this is the start of the while(1) loop:  loop 9454
input = -1
this is the start of the while(1) loop:  loop 9455
input = -1
this is the start of the while(1) loop:  loop 9456
input = -1
this is the start of the while(1) loop:  ltittiitiitiitiitittittittittitiitiiti39834
input = -1
this is the start of the while(1) loop:  loop 9835
input = -1
this is the start of the while(1) loop:  loop 9836
input = -1
this is the start of the while(1) loop:  loop 9837
input = -1
this is the start of the while(1) loop:  loop 9838
input = -1
this is the start of the while(1) loop:  loop 9839
input = -1
this is the start of the while(1) loop:  loop 9840
input = -1
this is the start of the while(1) loop:  loop 9841
input = -1
this is the start of the while(1) loop:  loop 9842
input = -1
this is the start of the while(1) loop:  loop 9843
input = -1
this is the start of the while(1) loop:  loop 9844
input = -1
this is the start of the while(1) loop:  loop 9845
input = -1
this is the start of the while(1) loop:  loop 9846
input = -1
this is the start of the while(1) loop: ittittittitiitittittittitiitittitiititt1
回复 支持 反对

使用道具 举报

发表于 2006-11-12 02:57:38 | 显示全部楼层
Post by hoho_zhao
昏晕几天!!!while(1)线程被莫名杀死!或阻塞!求救。。。
( 俺不知道while(1)函数的实例是否叫线程,若有错,请指正)

main()
{
   ......
   ......
   while(1){
// 如果没有输入就继续循环
// 若有输入就执行以下程序
  ......
   ......
  }
}

/* 中断处理函数,没各1秒钟,内核唤醒执行,可以中断while(1)循环 */
void inthandler()
{ printf("......");
   // 画一个圆圈
  .......
}

请问!!!中断处理函数有可能杀死while(1)或阻塞它么???
若有,那是什么样的情况?

呜呜。。。我想晕了。。。不得其解!

现实情况:
    程序执行后,while(1)转了几圈之后就停止了,只有中断程序还按时中断执行。。。。


提醒:并不是任何函数都可以在 sig_handler 中调用,其中也包括 printf
建议:google 一下 "异步信号安全函数"
回复 支持 反对

使用道具 举报

发表于 2006-11-12 11:26:11 | 显示全部楼层
贴一堆输出结果,也不贴代码?ft
回复 支持 反对

使用道具 举报

发表于 2006-11-12 11:27:09 | 显示全部楼层
Post by anthonylee
提醒:并不是任何函数都可以在 sig_handler 中调用,其中也包括 printf
建议:google 一下 "异步信号安全函数"

同意,可能是不能安全“重入”的问题。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-11-12 20:36:42 | 显示全部楼层
问题已想明白了!!!(灵感作用)
先说一下:不好意思,我是“交叉编译”,不是在PC上运行的代码,源代码有些混乱,数百行,很多都与我所遇到的问题无关,与讨论有关的代码有很难抽取,我是怕麻烦。。。

问题所在:(很可能,也许就是这样!!!)

ARM920处理器的能力有限,当发生几次后,中断程序要处理的问题增多了一两句,也许就因为增多了那几句(包含数需函数),结果就在那时发生了中断,中断被阻塞,结果就是,中断执行完毕后又是中断,中断无法返回!!!!

非常感谢 anO 前辈的指点!

痛苦啊,想了3天,大脑差点承受不住!(我最怕不明不白。。。)
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-11-12 20:38:34 | 显示全部楼层
忘记了,同时也感谢anthonylee 兄的指点

因为指点,所以感悟,呵呵
回复 支持 反对

使用道具 举报

发表于 2006-11-13 09:57:39 | 显示全部楼层
太客气了,大家交流讨论而已,呵呵,互相促进嘛;偶也Newbie的说
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表