interrupt

How to install interrupt handler for IPI in powerpc using MPIC ?

Do CPUs (specifically powerpc) allow an interrupt handler to be installed for IPIs (inter processor interrupts) ? The MPIC I am using supports 4 IPIs per core and it has registers for setting the vector and priority of these IPIs, but where should I install the interrupt handler ? The CPU core has IVORs (Interrupt Vector Offset Registers...

Java Hardware Interrupt Handling

I would like to know if it is possible to automatically invoke a Java method when a hardware interrupt is raised. ...

Alternative to interrupt_main() in Jython?

Whenever the code thread.interrupt_main() is used in Jython it doesn't actually interrupt the main thread. Any ideas as to alternatives? Code is below: import threading import dummy_thread as _thread def exitFunct(): _thread.interrupt_main() t = threading.Timer(60.0, exitFunct) t.start() for i in range(1, 3000): print i ...

How to kill deadlocked threads in Java?

I'd like to kill threads that are stuck in deadlock state. First, we can detect thread ids in deadlock state using the findDeadlockedThreads() method of the ThreadMXBean class in java.lang.management. Then, I'd like to kill the threads by thread ids, and thus I have two related questions: (1) How to get the control of a thread by threa...

Extern variable in ISR

Is it safe to use extern data qualifier for a variable in an ISR? ...

Java long running task Thread interrupt vs cancel flag

I have a long running task, something like: public void myCancellableTask() { while ( someCondition ) { checkIfCancelRequested(); doSomeWork(); } } The task can be cancelled (a cancel is requested and checkIfCancelRequested() checks the cancel flag). Generally when I write cancellable loops like this, I use a fl...

Forceful termination of a thread stuck on an API call of some method

My scenario is as follows: I am implementing a server that must timeout or produce a response within the specified timeout period for each request. Thus each request is ensured a response from the server's point of view (the response, of course, might not reach the client due to transport layer failure, etc...). In order to implement t...

Under what conditions will BlockingQueue.take throw interrupted exception?

Let us suppose that I have a thread that consumes items produced by another thread. Its run method is as follows, with inQueue being a BlockingQueue boolean shutdown = false; while (!shutdown) { try { WorkItem w = inQueue.take(); w.consume(); } catch (InterruptedException e) { shutdown = true; } } ...

Callback, specified in QueueUserAPC , does not get called

In my code, I use QueueUserAPC to interrupt the main thread from his current work in order to invoke some callback first before going back to his previous work. std::string buffer; std::tr1::shared_ptr<void> hMainThread; VOID CALLBACK myCallback (ULONG_PTR dwParam) { FILE * f = fopen("somefile", "a"); fprintf(f, "CALLBACK WAS IN...

HID input report queues on C8051F320

Hi, it seems that as soon as data is ready for the host (such as when I use WriteFile to send a command to the HID in which I tell the HID to give back some data such as the port value) and the in packet ready bit is set, the host reads it (as confirmed by another USB interrupt) before ReadFile ever is called. ReadFile is later used to p...

Is Thread.interrupt() evil?

A teammate made the following claim: "Thread.interrupt() is inherently broken, and should (almost) never be used". I am trying to understand why this is the case. Is it a known best practice never to use Thread.inerrupt()? Can you provide evidence why it is broken / buggie, and should not be used for writing robust multithreaded code? ...

Stack size required for bios interrupt call

I am working on a small bootloader for learning purposes. Is there any specification/information available about the (free) stack size required for a bios interrupt call? ...

Java Thread - weird Thread.interrupted() and future.cancel(true) behaviour

Hi all, I want to manage a list of Futures objects returned by my TaskExecutor. I've something like this List<Future<String>> list void process(ProcessThis processThis) { for ( ...) { Future<String> future = taskExecutor.submit(processThis); list.add(future) } } void removeFutures() { for(Future fu...

Java thread interrupts and joins (thread is still alive after join)

Hi all, trying to figure out some behavior. I've got some code that spawns one thread. It waits some amount of time, and then interrupts it, joins it and then exits the method. . . . try { Thread.sleep(processForMillis); } catch (InterruptedException ex) { // Won't happen, ignore. } for (Thread t : thre...

How do interrupts work on the Intel 8080?

How do interrupts work on the Intel 8080? I have searched Google and in Intel's official documentation (197X), and I've found only a little description about this. I need a detailed explanation about it, to emulate this CPU. ...

Programme goes unresponsive at ServerSocket.accept - Java

My programme listens for just one connection once... the programme just gets stuck at clientSocket = serverSocket.accept() if no client connects. I mean I can't even interrupt it by closing my window. I can't click any of my buttons in the frame etc. I've used this code the same way in my other programmes but it's worked fine (I can cli...

Stop Internet access on the emulator android

Hi, Ok my question might appear a bit strange but here is my problem : I am testing a database storage after retrieving data from the internet, then i would like to be able to start the emulator with internet working, and then, while it is running, stop internet access to force it using the database as a source to display data. Is that ...

Thread Interrupt

When an Thread.interrupt() is called on some thread, what happens to that thread? ...

How can I interrupt a synchronized statement in Java?

I have two threads that want to synchonize on the same object. Thead A needs to be able to interrupt Thread B if a certain condition has been fullfilled. Here is some pseudo-code of what the two threads do/should do. A: public void run() { while(true) { //Do stuff synchronized(shared) { //Do ...

Why is my masm32 program crashing whenever I try using interrupts?

Here's the code: .386 ;target for maximum compatibility .model small,stdcall ;model .code main: int 20h END main Result: http://img705.imageshack.us/img705/3738/resultom.png "test.exe has stopped working" - always right when it reaches the interrupt. This is the interrupt I'm trying to use. It should simply exit the ...