On Tue, Jul 16, 2019 at 2:29 PM Jaka Jančar <j...@kubje.org> wrote:
>
> On the motivation: I have user-provided (synchronous, relatively simple) 
> snippets of code that run 1k+ times/second on a server and must execute very 
> predictably and fast or they can affect the rest of the system/users.
>
> I'm using timer_create() with SIGEV_THREAD indeed (so not really managing my 
> own thread). Perhaps SIGEV_THREAD_ID would be faster, because there is no 
> scheduling/switching between two threads involved, but I was under the 
> impression that functions need to be async-signal-safe for that as well, just 
> as for SIGEV_SIGNAL. Can you explain why you think that is not the case?

With SIGEV_THREAD_ID you can just block the signal with
pthread_sigmask() and then wait race-free for delivery with
sigwaitinfo().

Having said that, unless there are other reasons to use timer_create()
or signals, it's probably easier to suspend with nanosleep() or
clock_nanosleep().

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-users/CAHQurc_7CwTdkvzTVCmHFP6xRa2%2B3E-xoftcbXCq6hbyz3GKvQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to