天道酬勤,学无止境

interruption

chat on assembly using serial port

I'm working on a chat using assembly and i got this huge doubt, I'm currently using int 21, AH= 0Ah to get a string from the keyboard wich I will later send, char by char, through the serial port, but then i was wondering how, will I receive a msg from the other computer running the same program if this one is in a interruption waiting for me to input a string. How can i get around the fact that when inputing a string, the whole program is interrupted and anything being sent on the mean time will be lost?

2022-02-15 04:11:21    分类:问答    assembly   x86   serial-port   dos   interruption

boost thread on interruption doesn't print exit message

I have this piece of code for executing three threads where the second thread should get interrupted on pressing enter and print the exit message: void input_val() { // DO STUFF return; } void process_val() { // DO STUFF try{ cout << "waiting for ENTER..." << endl; boost::this_thread::sleep(boost::posix_time::milliseconds(200)); } catch(boost::thread_interrupted&){ cout << "exit process thread" << endl; return; } return; } void output_val() { // DO STUFF } int main() { char key_pressed; boost::thread input_thread(boost::bind(&input_val)); boost::thread process_thread(boost::bind(&process_val))

2022-01-23 15:09:50    分类:问答    c++   multithreading   boost   boost-thread   interruption

捕获设备活动时未触发 AVAudioSessionInterruptionNotification(AVAudioSessionInterruptionNotification not triggered when capture device active)

问题 我在 iOS 7.0.4 上遇到“ AVAudioSessionInterruptionNotification ”问题。 我在 NSNotificationCenter 上注册它,然后激活 AVAudioSession。 一切正常,但是如果激活了相机,则不会再触发该特定通知,无论是中断的开始还是中断的结束。 我通过在 iPhone4 上接听手机来测试音频中断,并在应用程序运行时发出警报。 我还尝试将通知与“AVCam”示例应用程序一起使用,我也遇到了同样的问题。 音频中断和摄像头激活之间有什么关系? 如果打开相机,为什么会停止触发音频中断? 这可能是iOS错误吗? 2014 年 1 月 10 日编辑:我更新到 iOS 7.1 beta 3,但问题仍然存在。 谢谢你。 回答1 将相机/捕获设备对象属性 usesApplicationAudioSession 设置为 NO,一切都会好起来的 您可以使用 AVCaptureSession: captureSession = [[AVCaptureSession alloc] init]; ... captureSession.usesApplicationAudioSession = NO;

2022-01-11 23:57:18    分类:技术分享    audio   ios7   avaudiosession   avcapturedevice   interruption

AVAudioSessionInterruptionNotification not triggered when capture device active

I'm having a problem with "AVAudioSessionInterruptionNotification" on iOS 7.0.4. I sign up for it on the NSNotificationCenter, and I activate AVAudioSession. Everything works fine, but if a camera is activated, that particular notification is not triggered anymore, neither for the beginning of an interruption, nor for the end of it. I test audio interruptions by receiving cell calls on an iPhone4, and also by making an alarm ring while the app is running. I also tried using the notification with the "AVCam" sample app, and I have the same problem. What is the relationship between audio

2022-01-09 09:26:05    分类:问答    audio   ios7   avaudiosession   avcapturedevice   interruption

idt_table undefined! warning when compiling kernel module

I'm trying to use gate_desc *idt_table in a kernel module. The set_trap_gate() function defined in desc.h uses this pointer. In desc.h is also a definition : extern gate_desc idt_table[]. I tried different things: use idt_table in my module without definition or affectation affect idt_table with my (valid) idt_table address I get either an id_table undefined warning during compilation or incomplete type for idt_table. creating a new var named for instance gate_desc *it = (gate_desc *)@; And copy the set_trap_gate, set_gate, write_idt_entry, pack_gate functions from sched.h to my module file

2021-12-20 13:46:45    分类:问答    c   linux   module   kernel   interruption

如果运行该函数的线程被中断,finally 块是否执行?(Does the finally block execute if the thread running the function is interrupted?)

问题 如果我有一个带有 try/finally 部分的函数,并且运行它的线程在 try 块中被中断,finally 块会在中断实际发生之前执行吗? 回答1 根据 Java 教程,“如果执行try或catch代码的线程被中断或finally即使应用程序作为一个整体继续运行, finally块也可能不会执行。” 这是完整的段落: finally块总是在try块退出时执行。 这确保即使发生意外异常也能执行finally块。 但finally不仅仅用于异常处理——它允许程序员避免清理代码被return 、 continue或break意外绕过。 将清理代码放在finally块中始终是一个好习惯,即使没有预料到异常也是如此。 注意:如果在执行try或catch代码时 JVM 退出,则finally块可能不会执行。 同样,如果执行try或catch代码的线程被中断或finally即使应用程序作为一个整体继续运行, finally块也可能不会执行。 class Thread1 implements Runnable { @Override public void run() { try { Thread.sleep(10000); } catch (InterruptedException e) { e.printStackTrace(); } finally { System.out

2021-11-26 04:47:48    分类:技术分享    java   multithreading   try-catch   interrupt   interruption

Does the finally block execute if the thread running the function is interrupted?

If I have a function with a try/finally section, and the thread running it is interrupted while in the try block, will the finally block execute before the interruption actually occurs?

2021-11-19 23:30:49    分类:问答    java   multithreading   try-catch   interrupt   interruption

哪些系统调用可以返回 EINTR 或 EAGAIN 错误代码? [关闭](Which system calls can return EINTR or EAGAIN error codes? [closed])

问题 关闭。 这个问题需要更加集中。 它目前不接受答案。 想改善这个问题吗? 更新问题,使其仅通过编辑这篇文章来关注一个问题。 7年前关闭。 改进这个问题 以下哪个系统调用可以返回 EINTR 或 EAGAIN/EWOULDBLOCK? getsockname() chdir() bind() fcntl() listen() setsid() setsockopt() socket() stat() unlink() access() accept() open() usleep() dup2() fork() waitpid() wait() read() write() 其中一些系统调用在出错时返回 EINTR 或 EAGAIN(通过手册页的 API)。 还存在一些系统调用,API 不引用 EINTR/EAGAIN,但返回这些。 请帮忙。 回答1 我找到了答案。 这个问题不应该被删除。 通常,只有“慢”的系统调用才会返回 EINTR。 缓慢的事情是终端 I/O 和等待的事情(选择、等待、睡眠、暂停等)。

2021-11-19 18:38:57    分类:技术分享    c   posix   system-calls   interruption   manpage

Which system calls can return EINTR or EAGAIN error codes? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 7 years ago. Improve this question Which of the following system calls can return EINTR or EAGAIN/EWOULDBLOCK? getsockname() chdir() bind() fcntl() listen() setsid() setsockopt() socket() stat() unlink() access() accept() open() usleep() dup2() fork() waitpid() wait() read() write() Some of these system calls return EINTR or EAGAIN on error (by the API of man pages). Also some system calls exist

2021-11-14 04:09:44    分类:问答    c   posix   system-calls   interruption   manpage