interrupt

How to interrupt another thread from a monitor Thread

I know that this is ill advised but still i am trying to look into a method of interrupting a thread which hangs, from another thread which is keeping time. What i do is: I start the monitor thread just before a questionable network operation is about to happen. This thread is supposed to monitor the time elapsed since it was started an...

Android: how cancel/interrupt/break pending SQLite query?

In my Android application user can fill database with imported data, then perform predefined, complex SQL query. With some data pattern, query will take very long (minutes and more on HTC Hero), while common usage will not exceed 10-15 seconds. Is there any way to cancel pending SQLite query on Android? Timeout would be as good as well,...

Software interrupt

Hi, How can I program software interrupt in C? I know need to write an interrupt servicing routine and then interrupt the CPU so that the routine can be called, but I don't know how to do that in C. Also, I don't know how to register that routine with Interrupt descriptor table. I have an x86-64 CPU (AMD Turion64 X2) and I am using gcc c...

why did I get IllegalThreadStateException after calling this.interrupt()?

try { this.interrupt(); } catch (IllegalThreadStateException e) { e.printStackTrace(); } I found out that an IllegalThreadStateException was thrown by putting print statement, no stack trace was printed. I have tried searching existing threads about Thread.interrupt() and IllegalThreadStateException, but didn't get much out of ...

Thread.interrupt() What does it do ?

Could you explain me what does this function do when invoked? ...

Perl: How to add an interrupt handler so one can control a code executed by mpirun via system()?

We use a cluster with Perceus (warewulf) software to do some computing. This software package has wwmpirun program (a Perl script) to prepare a hostfile and execute mpirun: # ... system("$mpirun -hostfile $tmp_hostfile -np $mpirun_np @ARGV"); # ... We use this script to run a math program (CODE) on several nodes, and CODE is normally ...

Capturing user input at arbitrary times in python

Is there a way to send an interrupt to a python module when the user inputs something in the console? For example, if I'm running an infinite while loop, i can surround it with a try/except for KeyboardInterrupt and then do what I need to do in the except block. Is there a way to duplicate this functionality with any arbitrary input? Ei...

Interrupts in C/C++??? How are they implemented / coded?

Hello, Having programmed microcontrollers before and being interested in trying my hand at building an NES emulator at some point, I was really wondering how interrupts are implemented in C++? How, for example, does a program know how to react when I speak into my mic or move my mouse? Is it constantly polling these ports? When emulat...

Interrupt handling and transferring data from and to application code - low latency method theories

I have a Fibre Optic link, with a proprietary Device Driver and message format. The link goes into a PCIe card. Running on a RHEL 5.2 (2.6.18-128~) I have mmap'ed the interface on the card for setup and FIFO access etc, but cannot use this for interrupts as this should be done via the kernel-space interrupt routine (correct me if require...

USART transmit problems on a PIC

I'm trying to send data to an SD card from a PIC18f4580, but the PIC is not sending what it should be. related global variables: unsigned char TXBuffer[128]; //tx buffer unsigned char TXCurrentPos = 0x00; //tracks the next byte to be sent unsigned char TXEndPos = 0x00; //tracks where new data should be put into the array I am adding ...

ARM Cortex M3 How do I determine the program counter value before a hard fault?

Hi all, I have an embedded project using a STM32F103 (ARM Cortex M3), it is getting a occasionally getting hard fault in release mode. As part of recovery, I would like to retrieve the PC value from before the hard fault and store it for later debugging in the battery backed region. How would I determine the value of the program counte...

what is the best way to stop a thread in java?

I would like to stop a thread in mid execution. From reading around, I am of the thought I will have to check a local variable to determine if the thread should continue or clean up and exit run(). Any ideas of cleanly implementing this? ...

What happens if I disable an interrupt inside of its ISR?

What happens if you disable an interrupt inside that interrupt's ISR? For example, if I am transmitting data over USART from a buffer and that buffer runs out of data then I want to stop transmitting temporarily, so after sending the last byte in the buffer, I disable the interrupt. (This is on a PIC18F4580) The datasheet for the PIC18...

Where are key events created in android?

Hello, I want to be able to measure the "responsiveness" of an application automatically. So I want to get the time difference between the moment when I click a button (i.e. when the corresponding event has been created) and the moment when my onClick method is being run. Do you know what happens (what methods are being called) when I ...

How to interrupt a fread call?

I have the following situation: There is a thread that reads from a device with a fread call. This call is blocking as long as there is no data send from the device. When I stop this thread it remains hanging inside this thread. Now I found the following inside the man page of fread: ERRORS On all systems that conform to the...

Delay from mouse button click until a window message is posted (Windows)

This questions is relevant to an application I'm currently working on, but I don't have much to go on in terms of finding an answer. The basic questions is what is the delay (or how to estimate it) between the time that a user presses one of the mouse buttons until the information is posted to the window message queue and is available fo...

JavaScript method execution interruption

How can I interrupt execution of a JavaScript method? The method is scheduled using the "setTimeout" function in JavaScript, I need to interrupt that method execution(not by calling the "clearTimeout" function because it cannot interrupt a method execution during its execution but can cancel before it already started to executing, after ...

Why won't my program read from a usb interrupt endpoint

Hello. I am writing a libusb program to interact with a usb gamepad. I found it, opened it, detached from kernel, claimed interface, and when I try to usb_interrupt_read it returns -110 (resource temporarily unavailable) what is doing on? also, usb_set_configuration fails, so I commented it out. do I need it? Why isn't it reading? i = ...

Some sort of Ruby "Interrupt"

So here's what I'm doing -- I have a ruby script that prints out information every minute. I've also set up a proc for a trap so that when the user hits ctrl-c, the process aborts. The code looks something like this: switch = true Signal.trap("SIGINT") do switch = false end lastTime = Time.now while switch do if Time.now.min ...

How do I pass/catch/respond to Python's KeyboardInterrupt in C++?

I have a simple library written in C++ which I'm creating a Python wrapper for using boost.python. Some functions take a long time to execute (over 30 seconds), and I would like to make it interruptible so that when I hit ctrl-d to trigger KeyboardInterrupt in the python interpreter, I'm somehow able to respond to that in C++. Is there ...