interrupt

Python Multiprocessing atexit Error "Error in atexit._run_exitfuncs"

I am trying to run a simple multiple processes application in Python. The main thread spawns 1 to N processes and waits until they all done processing. The processes each run an infinite loop, so they can potentially run forever without some user interruption, so I put in some code to handle a KeyboardInterrupt: #!/usr/bin/env python im...

Keeping time using timer interrupts an embedded microcontroller

Hello, This question is about programming small microcontrollers without an OS. In particular, I'm interested in PICs at the moment, but the question is general. I've seen several times the following pattern for keeping time: Timer interrupt code (say the timer fires every second): ... if (sec_counter > 0) sec_counter--; ... Main...

How to run one last function before getting killed in Python?

Is there any way to run one last command before a running Python script is stopped by being killed by some other script, keyboard interrupt etc. Thanks for your help! ...

How can the processor recognize the device requesting the interrupt?

1) How can the processor recognize the device requesting the interrupt? 2) Given the different devices are likely to require different ISR How can the pressor obtain the starting address in each case? 3) Should a device be allowed to interrupt the processor while amother interrupt is being services? 4) How should two or more simultanemen...

How Does One Interrupt Bean Methods on Jboss?

EJB 3.1 is a few months away and starting threads in Beans is discouraged since it may have nasty side effects. So what other options are there to interrupt bean methods on Jboss and Enterprise servers? JDBC's setQueryTimeout is not an option since some drivers do not enforce the value. ...

How to terminate CXF webservice call within Callable upon Future cancellation

Edit This question has gone through a few iterations by now, so feel free to look through the revisions to see some background information on the history and things tried. I'm using a CompletionService together with an ExecutorService and a Callable, to concurrently call the a number of functions on a few different webservices throug...

java & threads: interrupted exceptions & how to properly use BlockingQueue's take() method

Hi all, My first question is what exactly happens when there is nothing on the queue and a take() is called. The API says the method will wait but does that mean the CPU spins checking for empty/not empty until an item is on the queue or does it mean that the thread yields and will be awoken by an interrupt? If it is the case of the f...

Thread.Interrupt to stop long sleep at app shutdown - Is there a better approach

I'm having a small background thread which runs for the applications lifetime - however when the application is shutdown, the thread should exit gracefully. The problem is that the thread runs some code at an interval of 15 minutes - which means it sleeps ALOT. Now in order to get it out of sleep, I toss an interrupt at it - my questio...

Timer Interrupt Service Routine on a host computer running at a rate of 10 microseconds or faster

I am trying to run the following pseudocode at a rate of 10 microseconds or faster on a host computer (512 mb RAM, Intel 2.5 GHz Pentium 4 processor, etc.) running on a Windows XP operating system: int main(void) { while(1){}; } Interrupt service routine: every 10 microseconds, printf("Hello World"); I'm aware that there are MFC ...

How do you test your interrupt handling module?

I've got an interrupt handling module which controls the interrupt controller hardware on an embedded processor. Now I want to add more tests to it. Currently, the tests only tests if nesting of interrupts works by making two software interrupts from within an ISR, one with low priority and one with high priority. How can I test this mod...

What is INT 21h?

Inspired by this question http://stackoverflow.com/questions/1237489/how-can-i-force-gdb-to-disassemble I wondered about the INT 21h as a concept. Now, I have some very rusty knowledge of the internals, but not so many details. I remember that in C64 you had regular Interrupts and Non Maskable Interrupts, but my knowledge stops here. C...

ISR - Maximum Data Rate

The interrupt service routine (ISR) for a device transfers 4 bytes of data from the device on each device interrupt. On each interrupt, the ISR executes 90 instructions with each instruction taking 2 clock cycles to execute. The CPU takes 20 clock cycles to respond to an interrupt request before the ISR starts to execute instructions. Ca...

Windows processes in kernel vs system

I have a few questions related to Windows processes in kernel and usermode. If I have a hello world application, and a hello world driver that exposes a new system call, foo(), I am curious about what I can and can't do once I am in kernel mode. For starters, when I write my new hello world app, I am given a new process, which means I ...

Regarding interrupt based communication

We have a simple architecture : Main chip (arm9 based) PIC controller The PIC communicates to ARM via an interrupt based I2C communication protocol for transfer of data. Inside the interrupt we signal a task which reads the data from the I2C layer (bus). In case the data is limited we usually won't have much problem to read the data...

cp command within php resulted in a partial copy

I have a small PHP script I wrote to help me push changes from staging to production. I run both staging and prod on the same server so my script copies changes from staging folders to prod folder. This has been working fine until today when I had a few instances when files were only partially copied over resulting in some down time....

Interrupt Handling on SMP Systems

Are Interrupts assigned to a fixed CPU (always handled by the same CPU)? To put my question in context: From: http://msdn.microsoft.com/en-us/library/ms795060.aspx The spin lock that protects the shared area has an IRQL equal to the DIRQL at which the device interrupts. As long as the critical-section routine holds the spin lock and a...

Disable Hardware & Software Interrupts

Hello! Is it possible to disable all interrupts with a ASM/C/C++ program to get full control about the processor? If yes -> how? If not -> how do "atomic" operation system calls work (for example entering a critical section)? Sorry for my English! Thanks for your help! ...

Windows Interrupt Context

I am doing driver development under Windows (extended with real-time extension RTX from Interval Zero) Although I don't see anything in the RTX documentation, is there a function that one can use to tell if the current location of code is called from within an interrupt context? ...

Is this thread safe? (shared data without mutex/semaphore)

So this is a very particular question: I use an embedded system with a single CPU core. I have one main thread and an interrupt. They share a 32-bit float. The interrupt writes the float, and the main thread reads it. Reads and writes are not synchronized. The processor documentation states that the 32-bit read is a one-cycle operatio...

IRQ Numbering Conflict

From: http://software.intel.com/en-us/articles/introduction-to-pc-architecture/ Exception number 10h corresponds to a "Floating Point Error" but software interrupt 10h also corresponds to "Video support" BIOS interrupts (both in real mode). What am I missing? ...