首页
学习
活动
专区
工具
TVP
发布

LieBrother

专栏作者
62
文章
37939
阅读量
15
订阅数
synchronized 实现原理
前面 3 篇文章讲了 「synchronized」 的同步方法和同步代码块两种用法,还有锁实例对象和锁 Class 对象两种锁机制。今天我们来看看同步方法和同步代码块的实现原理。
LieBrother
2020-05-25
4220
synchronized 代码块怎么用
之前 2 篇文章我们已经知道 「synchronized」 的使用方法以及锁的内容(实例对象和Class类对象),这已经涵盖了这个关键字的基本内容了,今天这篇想介绍一下另一种写法,就是「同步代码块」,它实现了更细粒度的同步方式。下面来见分晓。
LieBrother
2020-05-25
6080
用不用 synchronized 的区别?
今天一起来认识认识 「synchronized」 这个一面试就会被提到的关键字。这一篇不会讲太多理论,主要先熟悉熟悉一下最简单的用法。只讨论一个问题:「方法没用 synchronized 和用了 synchronized 有什么区别?」
LieBrother
2020-05-25
3180
程序员已经很好了,但是,很难更好了
聊点有的没的: 程序员就是这么一群人,比上不足比下有余。 不要太羡慕我们,也请不要鄙视我们…… 我们的工作环境还挺好的,收入也的确挺好的~ 但是, 假如生活欺骗了你,找50个程序员问问为什么编程; 假如生活让你想死,找50个程序员问问BUG改完了没有; 假如你觉得生活拮据,找50个程序员问问工资涨了没有; 假如你觉得活着无聊,找50个程序员问问他们一天都干了什么! 然后你就会发现,我们的日子其实并没有好到哪去_(:з」∠)_ 愿世界没有BUG,愿需求只改一次,愿自己不再是一个没有对象的野指针。 P.S.
LieBrother
2020-05-25
3800
删除排序链表中的重复元素【文末附思维导图】
题目中有一个特殊且重要的条件,就是排序,这个链表是已经排好序的,那么如果存在相同的元素,一定是相邻的节点,这就好办了,我们可以通过遍历一次链表,在遍历过程中判断当前节点的 val 和下一个节点的 val 是不是相等,如果相等则删除下个节点,以此类推,直到遍历完链表。
LieBrother
2020-05-25
4530
老板叫你别阻塞了
继续咱们的 Java 多线程系列文章,今天再讲讲概念,这篇应该是最后一篇基础概念,接下来就直接进入 Java 多线程主题了,在后面的文章里如果有概念需要单独拿出来讲时再补充概念篇。
LieBrother
2019-08-09
3710
泡一杯茶,学一学同异步
接下来几篇会给大家屡清楚多线程中涉及到的一些概念,理解了这些概念,往后的文章才好明白。
LieBrother
2019-07-08
3620
进程知多少?
1 进程为什么出现?2 进程的组成3 如何竞争资源(调度算法)3.1 FCFS3.2 RR3.3 SPN3.4 SRT3.5 HRRN3.6 FB4 进程状态4.1 三态图4.2 五态图4.3 七态图5 进程关系5.1 父子关系5.2 僵尸进程5.3 孤儿进程6 执行模式7 进程间通讯7.1 管道(Pipe)7.2 流管道(Flow Pipe)7.3 有名管道(Named Pipe)7.4 信号量(Semophore)7.5 信号(Signal)7.6 消息队列(Message Queue)7.7 共享内存(Shared Memory)7.8 套接字(Socket)8 总结
LieBrother
2019-06-24
6310
行为型模式:解释器模式
姓名 :解释器模式 英文名 :Interpreter Pattern 价值观 :不懂解释到你懂 个人介绍 : Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language. 给定一门语言,定义它的文法的一种表示,并定义一个解释器,该解释器使用该表示来解释语言中的句子。 (来自《设计模式之禅》)
LieBrother
2019-04-23
3400
里氏替换原则
1. If for each object o1 of type S there is an object o2 of type T such that for all programs P defined in terms of T,the behavior of P is unchanged when o1 is substituted for o2 then S is a subtype of T.
LieBrother
2019-04-02
5320
行为型模式:命令模式
Encapsulate a request as an object,thereby letting you parameterize clients with different requests,queue or log requests,and support undoable operations.
LieBrother
2019-04-02
3420
行为型模式:中介者模式
Define an object that encapsulates how a set of objects interact.Mediator promotes loose coupling by keeping objects from referring to each other explicitly,and it lets you vary their interaction independently.
LieBrother
2019-04-02
3220
行为型模式:模板方法
Define the skeleton of an algorithm in an operation,deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.
LieBrother
2019-04-02
4160
创建型模式:原型模式
Specify the kinds of objects to create using a prototypical instance,and create new objects by copying this prototype.
LieBrother
2019-04-02
3860
创建型模式:建造者模式
Separate the construction of a complex object from its representation so that the same construction process can create different representations.
LieBrother
2019-04-02
4860
创建型模式:抽象工厂
Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
LieBrother
2019-04-02
3710
创建型模式:工厂方法
Define an interface for creating an object,but let subclasses decide which class to instantiate.Factory Method lets a class defer instantiation to subclasses. (定义一个用于创建对象的接口,让子类决定实例化哪一个类。工厂方法使一个类的实例化延迟到其子类。)
LieBrother
2019-04-02
3570
行为型模式:状态模式
姓名 :状态模式 英文名 :State Pattern 价值观 :有啥事让状态我来维护 个人介绍 : Allow an object to alter its behavior when its internal state changes.The object will appear to change its class. 当一个对象内在状态改变时允许其改变行为,这个对象看起来像改变了其类。 (来自《设计模式之禅》)
LieBrother
2019-04-02
5220
行为型模式:迭代器模式
Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
LieBrother
2019-04-02
3310
行为型模式:策略模式
Define a family of algorithms,encapsulate each one,and make them interchangeable.
LieBrother
2019-04-02
3490
点击加载更多
社区活动
腾讯技术创作狂欢月
“码”上创作 21 天,分 10000 元奖品池!
Python精品学习库
代码在线跑,知识轻松学
博客搬家 | 分享价值百万资源包
自行/邀约他人一键搬运博客,速成社区影响力并领取好礼
技术创作特训营·精选知识专栏
往期视频·千货材料·成员作品 最新动态
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档