V2EX azygote 的所有回复 第 1 页 / 共 4 页
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX    azygote    全部回复第 1 页 / 共 4 页
回复总数  72
1  2  3  4  
2021 年 2 月 15 日
回复了 ChenXuting 创建的主题 汽车 问卷调查系列, V 友们都开什么车?
26 C 系
2020 年 11 月 19 日
回复了 levizheng 创建的主题 Java 咨询一个关于 synchronized 问题
@levizheng 仔细读这段 "Due to the semantics of some programming languages, the code generated by the compiler is allowed to update the shared variable to point to a partially constructed object before A has finished performing the initialization. For example, in Java if a call to a constructor has been inlined then the shared variable may immediately be updated once the storage has been allocated but before the inlined constructor initializes the object.[6]"
如果不加 volatile, 有个线程对 uniqueInstance 初始化到一半,另外一个线程执行到 synchronized 外面的那个 if (uniqueInstance == null) 是可能返回 false 的,也就读到的不是 null,而是一个初始化了一半的对象。
2020 年 11 月 19 日回复了 aiqier 创建的主题 程序员 Java 的 web 服务会在什么情况下读磁盘?
如果日志框架是 log4j/log4j2, 然后启用了 rolling file appender 的话,是会向硬盘写日志的
2020 年 11 月 19 日
回复了 levizheng 创建的主题 Java 咨询一个关于 synchronized 问题
volatile 的作用主要是为了 synchronized 外面那个 if 的。如果不加 volatile 的话,会出现一个情况:有一个线程正在对 uniqueInstance 赋值,由于没有 volatile 关键字,uniqueInstance 可能返回一个初始化一半了的对象,然后这时恰好另外一个线程正好执行到 if (uniqueInstance == null),得到结果为 false 然后直接返回, 但实际上这个 uniqueInstance 读到的值并没有初始化完成,导致返回了初始化了一半的对象,最后造成程序 crash 。

引自维基百科: https://en.wikipedia.org/wiki/Double-checked_locking

Intuitively, this algorithm seems like an efficient solution to the problem. However, this technique has many subtle problems and should usually be avoided. For example, consider the following sequence of events:

Thread A notices that the value is not initialized, so it obtains the lock and begins to initialize the value.

Due to the semantics of some programming languages, the code generated by the compiler is allowed to update the shared variable to point to a partially constructed object before A has finished performing the initialization. For example, in Java if a call to a constructor has been inlined then the shared variable may immediately be updated once the storage has been allocated but before the inlined constructor initializes the object.[6]

Thread B notices that the shared variable has been initialized (or so it appears), and returns its value. Because thread B believes the value is already initialized, it does not acquire the lock. If B uses the object before all of the initialization done by A is seen by B (either because A has not finished initializing it or because some of the initialized values in the object have not yet percolated to the memory B uses (cache coherence)), the program will likely crash.
估计是内存泄露了
你需要这个包 https://github.com/FasterXML/jackson-datatypes-collections 来进行 Guava 里面的一些 Collections 类的序列 /反序列化
基本使用 Waze, 偶尔用 Google Map, 坐标美帝
回溯法
2018 年 9 月 30 日
回复了 tsukiikekaoru 创建的主题 MacBook 你萌的 winrar 在虚拟下能正常使用吗
bandizip 了解一下?
@lzbnet 如果是双币卡的话绑定 paypal 需要改一下支付通道,因为国区 paypal 绑卡默认走银联,需要手动改成 Visa 或者 MasterCard
亲测 netflix 用国区 paypal 支付没有问题
2018 年 7 月 18 日
回复了 shazh520 创建的主题 Java spring boot 2.0 参数绑定好像不一样了
POST 的话不需要 @RequestParam 的吧
2018 年 6 月 28 日
回复了 zenio 创建的主题 问与答 夏天有哪些不错的冷饮推荐?
冰美式咖啡
2018 年 6 月 22 日
回复了 hansonwang99 创建的主题 程序员 SpringBoot 热部署加持
devtools 没 jrebel 好用
2018 年 5 月 23 日
回复了 rogwan 创建的主题 问与答 有好用的团队 Wiki 推荐的吗?
confluence + JIRA
2018 年 4 月 5 日
回复了 AnthonyLau 创建的主题 Python 想学 Python ,哪本书入门好一点
《 Fluent Python 》
2018 年 3 月 26 日
回复了 DXDE443 创建的主题 Java 请教大佬们一个关于 springmvc 的一个简单问题
你这里 Job 对象类似一个容器,这个对象的每个字段对应你 get 请求的键值对,这个设计很合理,因为你 get 请求传参数肯定一个参数一个参数中间加&来传的,不存在直接传一个对象过来。
1  2  3  4  
关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     1170 人在线   最高记录 6679       Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 40ms UTC 17:54 PVG 01:54 LAX 09:54 JFK 12:54
Do have faith in what you're doing.
ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86