lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sun, 16 Sep 2007 03:16:52 -0400
From:	Kyle Moffett <mrmacman_g4@....com>
To:	Heikki Orsila <shdl@...alwe.fi>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: On thread scheduling

On Sep 14, 2007, at 18:40:00, Heikki Orsila wrote:
> Consider a simple embedded system:
>
> void interrupt_handler(void)
> int main(void)
>
> I would like to "emulate" this system with a workstation to make  
> development faster. I would create two threads, one executing the  
> main() function, and the other occasionally calling  
> interrupt_handler().  Before interrupt_handler() is called, the main 
> () thread should be stopped asynchronously.

Actually you probably just want to do this with an ordinary single- 
threaded program.  Just do your main() thing normally and schedule a  
signal-based timer at program start (or whenever you actually set up  
your periodic interrupt source);  the timer signal-handler will act  
as the interrupt handler.  Alternatively you could have 2 threads  
where the *only* thing the second thread does is a timed poll() loop  
on an FD where it reads commands from the main thread.  When the main  
thread wants to change the interval-between-interrupts or some other  
interrupt configuration it writes the info down the FD to the  
alternate thread which actually sets up the change.  The main program  
then continues running and periodically receives its SIGUSR1 or  
whatever from the other thread and uses that as the interrupt.

Cheers,
Kyle Moffett

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ