- 博客(5)
- 资源 (4)
- 收藏
- 关注
原创 线程池中的线程何时死亡?
文章目录本文产生的原因结论Thread线程状态线程池中提交任务threadPoolExecutor#execute(runnable)addWorker(firstTask)线程状态new: newWorker(command)->getThreadFactory().newThread(this)线程状态runnable:worker.thread.start()线程状态running:w...
2019-08-02 11:40:35 4842 5
原创 MongoDB中remove与deleteMany的区别?
deleteMany/remove都可以添加writeConcern参数,表明是否关注writeConcernWhat’s the difference between “deletemany” and “remove” in mongodb?As far as I can say,db.collection.deleteManyReturns:A document containin...
2019-08-26 18:36:28 8422 9
原创 SpringAop时Null return value from advice does not match primitive return type for: public int...异常
原因接口是返回基本类型(primitive),切面拦截后返回了null。Null return value from advice does not match primitive return type for: public int …模拟proceed异常后,obj将是null。这里手动处理了null值,避免更优雅的方式1接口使用包装类而不是基本类型。更优雅的方式2避免在...
2019-08-13 15:12:40 15209 1
原创 keepAliveTime为0以及队列太小导致ThreadPoolExecutor不断创建新线程
产生原因群友问题:使用ThreadPoolExecutor实现固定大小的线程池,但是程序跑一段时间后,就会重新创建新的线程,求问有人遇到过这个问题吗?询问工作队列,最大线程数,超时时间参数值设置猜测怀疑 keepAliveTime为0,导致runWorker期间,getTask不等待。线程池new ThreadPoolExecutor(corePoolSize, max...
2019-08-12 18:24:02 3171
原创 SocketInputStream.socketRead0引起线程池提交任务后,futureTask.get超时
文章目录现象结论相关代码查看堆栈:查看submitCallThreadPoolExecutor#execute最终调用了 RunnableFuture#run方法从代码层面判断 futureTask.get超时只影响了业务线程(调用futureTask.get的线程),不影响工作线程。future.get测试future.get并不能打断线程池的线程。查看工作线程为何阻塞修复现象线上发短信、邮...
2019-08-07 11:04:05 1444
PyInstaller-3.2.zip
2016-07-31
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人