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>] [day] [month] [year] [list]
Date:	Sat, 10 Apr 2010 09:26:24 +0200
From:	"Frantisek Rysanek" <Frantisek.Rysanek@...t.cz>
To:	linux-kernel@...r.kernel.org
CC:	bill o gallmeister <bog.kernel@...il.com>
Subject: Re: setitimer vs. threads: SIGALRM returned to which thread? (process master or individual child)

On 9 Apr 2010 at 23:26, bill o gallmeister wrote:
>
> Check out timer_create() rather than setitimer().
> 
Oh I *see* :-)  There seems to be a way to deliver an event to a 
specific thread. Just a quick guess, haven't validated this by a 
compiler:

============ PSEUDOCODE SNIPPET ==========
struct my_thr_data
{
   pthread_t ID; /* to be set upon pthread_create() */
   /* ...further members... */
};

void* my_fn(void* my_user_data)
{
    pthread_kill( ((my_thr_data*)my_user_data)->ID, SIGALRM);
}

struct my_thr_data this_thread;
timer_t my_timer;
struct sigevent my_event =
{
   sigev_notify: SIGEV_THREAD,
   sigev_notify_function: my_fn,
   sigev_value.sival_ptr: &this_thread,
   sigev_notify_attributes: NULL   
}

timer_create(CLOCK_REALTIME, &my_event, &my_timer);

/* by now we're set up, but the timer doesn't tick yet. */

/* someplace later in the code: */
timer_settime(my_timer, ...  );


=========== /PSEUDOCODE SNIPPET ==============
thank you :-)

Frank Rysanek
--
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