Welcome! Log In Create A New Profile

Advanced

Nginx mutli-threaded plugin

January 01, 2013 01:28PM
Hi guys

I need to write a plugin which does some CPU intensive work. I want to be
able to create a thread which does some work and once done post an event
into nginx thread via ngx_add_timer. I tried compiling my plugin with
NGX_THREADS=pthread but that doesnt configure saying that the threading
support is broken. I can obviously switch to a single threaded mode but
that would be significantly difficult for me and would prefer to use only
as the very last resort.

Can you please advice how to go about doing this? I am considering pulling
out the usage of 'ngx_event_timer_mutex' outside #if NGX_THREADS. Frankly I
am surprised how no other plugin had this kind of requirement, the "broken
support" commit has been there since quite some time now.

One final question, if I do the CPU intensive work in the nginx thread and
I have <cpu-cores> number of workers, how would the system behave? Will
accept_mutex on/off change the behavior?

Regards,
+Fasih
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Nginx mutli-threaded plugin

faskiri.devel 1816 January 01, 2013 01:28PM

Re: Nginx mutli-threaded plugin

Maxim Dounin 662 January 01, 2013 04:20PM

Re: Nginx mutli-threaded plugin

faskiri.devel 646 January 02, 2013 12:08AM

Re: Nginx mutli-threaded plugin

Maxim Dounin 594 January 03, 2013 10:28PM

Re: Nginx mutli-threaded plugin

faskiri.devel 647 January 04, 2013 02:54AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 144
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready