( ! ) Deprecated: Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers. in /var/www/html/wp-includes/functions.php on line 6131
Call Stack
#TimeMemoryFunctionLocation
10.0000484048{main}( ).../index.php:0
20.0000484400require( '/var/www/html/wp-blog-header.php ).../index.php:17
30.08714094792require_once( '/var/www/html/wp-includes/template-loader.php ).../wp-blog-header.php:19
40.08764123784include( '/var/www/html/wp-content/themes/twentyfifteen/single.php ).../template-loader.php:125
50.08764123784get_header( $name = ???, $args = ??? ).../single.php:10
60.08764124000locate_template( $template_names = [0 => 'header.php'], $load = TRUE, $load_once = TRUE, $args = [] ).../general-template.php:48
70.08764124096load_template( $_template_file = '/var/www/html/wp-content/themes/twentyfifteen/header.php', $load_once = TRUE, $args = [] ).../template.php:749
80.08764124640require_once( '/var/www/html/wp-content/themes/twentyfifteen/header.php ).../template.php:814
90.08784132048wp_head( ).../header.php:18
100.08784132048do_action( $hook_name = 'wp_head' ).../general-template.php:3197
110.08784132264WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
120.08784132264WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
130.08794135680wp_enqueue_scripts( '' ).../class-wp-hook.php:341
140.08794135680do_action( $hook_name = 'wp_enqueue_scripts' ).../script-loader.php:2311
150.08794135896WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
160.08794135896WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
170.08814137784twentyfifteen_scripts( '' ).../class-wp-hook.php:341
180.08824139304wp_style_add_data( $handle = 'twentyfifteen-ie', $key = 'conditional', $value = 'lt IE 9' ).../functions.php:440
190.08824139304WP_Styles->add_data( $handle = 'twentyfifteen-ie', $key = 'conditional', $value = 'lt IE 9' ).../functions.wp-styles.php:245
200.08824139304WP_Dependencies->add_data( $handle = 'twentyfifteen-ie', $key = 'conditional', $value = 'lt IE 9' ).../class-wp-styles.php:385
210.08824139304_deprecated_argument( $function_name = 'WP_Dependencies->add_data()', $version = '6.9.0', $message = 'IE conditional comments are ignored by all supported browsers.' ).../class-wp-dependencies.php:317
220.08824145256wp_trigger_error( $function_name = '', $message = 'Function WP_Dependencies->add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:5925
230.08834264792trigger_error( $message = 'Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:6131

( ! ) Deprecated: Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers. in /var/www/html/wp-includes/functions.php on line 6131
Call Stack
#TimeMemoryFunctionLocation
10.0000484048{main}( ).../index.php:0
20.0000484400require( '/var/www/html/wp-blog-header.php ).../index.php:17
30.08714094792require_once( '/var/www/html/wp-includes/template-loader.php ).../wp-blog-header.php:19
40.08764123784include( '/var/www/html/wp-content/themes/twentyfifteen/single.php ).../template-loader.php:125
50.08764123784get_header( $name = ???, $args = ??? ).../single.php:10
60.08764124000locate_template( $template_names = [0 => 'header.php'], $load = TRUE, $load_once = TRUE, $args = [] ).../general-template.php:48
70.08764124096load_template( $_template_file = '/var/www/html/wp-content/themes/twentyfifteen/header.php', $load_once = TRUE, $args = [] ).../template.php:749
80.08764124640require_once( '/var/www/html/wp-content/themes/twentyfifteen/header.php ).../template.php:814
90.08784132048wp_head( ).../header.php:18
100.08784132048do_action( $hook_name = 'wp_head' ).../general-template.php:3197
110.08784132264WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
120.08784132264WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
130.08794135680wp_enqueue_scripts( '' ).../class-wp-hook.php:341
140.08794135680do_action( $hook_name = 'wp_enqueue_scripts' ).../script-loader.php:2311
150.08794135896WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
160.08794135896WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
170.08814137784twentyfifteen_scripts( '' ).../class-wp-hook.php:341
180.11654265896wp_style_add_data( $handle = 'twentyfifteen-ie7', $key = 'conditional', $value = 'lt IE 8' ).../functions.php:444
190.11654265896WP_Styles->add_data( $handle = 'twentyfifteen-ie7', $key = 'conditional', $value = 'lt IE 8' ).../functions.wp-styles.php:245
200.11654265896WP_Dependencies->add_data( $handle = 'twentyfifteen-ie7', $key = 'conditional', $value = 'lt IE 8' ).../class-wp-styles.php:385
210.11654265896_deprecated_argument( $function_name = 'WP_Dependencies->add_data()', $version = '6.9.0', $message = 'IE conditional comments are ignored by all supported browsers.' ).../class-wp-dependencies.php:317
220.11654266216wp_trigger_error( $function_name = '', $message = 'Function WP_Dependencies->add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:5925
230.11664266440trigger_error( $message = 'Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:6131

逻辑划分线程池

现在很多系统中,特别是事件驱动的系统中,对于线程池的维护很多时候根据业务处理类型的不同做划分和管理,但分开维护会带来下面两个问题:

1. 到处线程池,每个线程池都有上限设置,但是所有线程池到达上限的时候也许系统已经无法承受了,所以局部设计和限制无法达到全局限制的目标。

2. 合理的利用线程池的资源,当线程池逻辑上真实隔离后,就无法将空闲的线程资源借调给繁忙的任务处理使用。

设计中关注的:

虚拟隔离线程池需要有模型可以保证对于一些处理的保护,对于一些处理的降级。

设计思路:

简单的两种配置模式:保留,限制。

举个例子:

默认线程池大小设置为100。

A类任务设置为保留10,B类任务设置为限制50。

假设有A,B,C三种任务进入。

A最大可以使用100个线程,其中10个是它独占的(通过配置可以选择优先使用公有的还是私有的)

B最大可以使用50个线程,当公有线程(100-10=90)被消耗后剩余总数小于50,那么B消耗的数量就会小于50,假如公有90个线程都没有被消耗,此时B最多也只能消耗50个线程。总结来说,B消耗公有的线程资源,同时最多只能消耗他的设置(当然他设置如果超过公有线程,则以公有线程池最大作为上限)

C最大可以使用90个线程,也就是所有的公有线程。

当任何一种请求没有线程资源可以被使用的时候,将会被放入队列,等待线程可用,队列不区分任务类型。

第一版简单的Java代码参看:http://www.rayfile.com/zh-cn/files/66a89e61-4357-11e0-9ad5-0015c55db73d/
这里只是探讨一种简单的设计思路,以最小代价来全局化管理维护线程池或者资源池。

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.