这里先简单描述一下问题,

场景:在一个线程中创建了另外一个线程处理一部分业务,

主线程对数据库进行新增操作,在操作结束后,启动一个新的线程去执行查询插入的数据的查询操作,发现了数据没有查询的问题。

下面我们我们直接上代码:

@Service
@Transactional
@Slf4j
public class RPatientService extends BaseService<RPatient, RPatientExample> {@Autowiredprivate SequenceIdGenerator sequenceIdGenerator;@Autowiredprivate WeChatMessageService weChatMessageService;@Autowiredprivate RPatientMapper rPatientMapper;@Autowiredprivate RReportIllnessService rReportIllnessService;@Autowiredprivate ImSessionUserService imSessionUserService;@Autowiredprivate RDoctorService rDoctorService;public void registerPS(String openId, String doctorId, byte status) {//按openId查询用户synchronized (openId.intern()) {RUser rUser = rUserService.getRUserByOpenId(openId);RPatient rPatient = null;if (rUser == null) {//用户不存在插入用户rUser = rUserService.createUserByOpenIdAndPS(openId, Constant.RUSER_TYPE_0_PATIENT, status);//新增患者rPatient = initPatient(rUser);log.info("[RPatientService]:new patient join:{}", JsonUtil.toJson(rUser));} else if (rUser.getType() == Constant.RUSER_TYPE_1_DOCTOR) {//医生扫描医生二维码,不处理return;}if (rPatient == null) {rPatient = this.getPatientByUserId(rUser.getId());if(rPatient == null){log.error("[RPatientService]: patient not exist:{}", JsonUtil.toJson(rUser));return ;}}Long rDoctorId = null;if (!StringUtils.isEmpty(doctorId)) {//报到   关联医生和患者生成reportrDoctorId = Long.valueOf(doctorId);RDoctor rDoctor = rDoctorService.getDoctorById(rDoctorId);if(rDoctor == null){log.error("[RPatientService]: doctor not exist:doctorId:{}", doctorId);return;}rReportService.report(rDoctorId, rPatient.getId());}eventBus.post(new PatientEvent(rUser.getId(), rDoctorId));//新//this.registerEvent(new PatientEvent(rUser.getId(), rDoctorId));}}//EventBus执行@Subscribe@AllowConcurrentEventspublic void registerEvent(PatientEvent patientEvent) {log.info("[PatientEvent]:{}", JsonUtil.toJson(patientEvent));Long rUserId = patientEvent.getrUserId();if (rUserId == null) {return;}RUser rUser = rUserService.selectByPrimaryKey(rUserId);RPatient rPatient = this.getPatientByUserId(rUserId);
//        RReport rReport = rReportService.getByPatientId(rPatient.getId());if (StringUtils.isEmpty(rPatient.getPhone())) {//提示用户身份验证weChatMessageService.sendToIdentityVerificationKFMsgForPatient(rUser.getVxopenid());} else if (patientEvent.getrDoctorId() != null) {//创建会话rReportService.createNewSession(rPatient.getId());//已关联医生,提示选择疾病weChatMessageService.sendToChoiceIllnessKFMsgForPatient(rUser.getVxopenid(), patientEvent.getrDoctorId());}}}

新增操作的代码:

@Service
@Transactional
@Slf4j
public class RReportService extends BaseService<RReport, RReportExample> {@Autowiredprivate SequenceIdGenerator sequenceIdGenerator;@Autowiredprivate RReportMapper rReportMapper;@Autowiredprivate RPatientService patientService;@Autowiredprivate ImSessionService imSessionService;public RReport report(Long doctorId, Long patientId) {RReport rReport = getByDoctorIdPatientId(doctorId, patientId);if (rReport == null) {rReport = initRReport(doctorId, patientId);log.info("new report generate:{}", JsonUtil.toJson(rReport));}return rReport;}//插入数据private RReport initRReport(Long doctorId, Long patientId) {RReport rReport = new RReport();rReport.setRdoctorid(doctorId);rReport.setRpatientid(patientId);rReport.setCreatetime(new Date());insertOrUpdate(rReport);return rReport;}//EventBus新事务执行的代码public void createNewSession(Long patientId) {RPatient rPatient = patientService.selectByPrimaryKey(patientId);if (StringUtils.isEmpty(rPatient.getPhone())) {log.info("患者没有完善个人信息,需要先完善个人信息!");return;//未完善信息的不处理}RReportExample rReportExample = new RReportExample();rReportExample.createCriteria().andRpatientidEqualTo(patientId).andImsessionidIsNull();List<RReport> rReportList = this.selectByExample(rReportExample);log.info("查询隐患报道关系." + "数量只能有一条:" + rReportList.size() + "记录信息=" + rReportList.toString());if (rReportList != null && rReportList.size() != 0) {for (RReport rReport : rReportList) {Long doctorId = rReport.getRdoctorid();//创建会话ImSession imSession = imSessionService.createNewSession(doctorId, patientId);rReport.setImsessionid(imSession.getId());this.insertOrUpdate(rReport);//更新会话ID}}ImSessionExample imSessionExample = new ImSessionExample();imSessionExample.createCriteria().andCreateuseridEqualTo(patientId).andSessiontypeEqualTo((byte) 2);ImSession a = imSessionService.selectOneByExample(imSessionExample);if (a == null) {//创建客服imSessionService.createNewSession2(424987751667077198L, patientId);}}}

下面直接看我分析服务器打出一段日志就可以了

############这里创建了一个事务    35ea154e        http-nio-8081-exec-10线程编号
2020-01-11 11:13:47.834 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | org.springframework.jdbc.datasource.DataSourceTransactionManager | Creating new transaction with name [com.framework.code.service.report.RPatientService.registerPS]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
2020-01-11 11:13:47.836 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | org.springframework.jdbc.datasource.DataSourceTransactionManager | Acquired Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@5c225ae5 [wrapping: com.mysql.jdbc.JDBC4Connection@35ea154e]] for JDBC transaction
########切换JDBC事务并且交给Spring管理
2020-01-11 11:13:47.837 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | org.springframework.jdbc.datasource.DataSourceTransactionManager | Switching JDBC Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@5c225ae5 [wrapping: com.mysql.jdbc.JDBC4Connection@35ea154e]] to manual commit
############参与当前的事务 35ea154e
2020-01-11 11:13:47.837 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | org.springframework.jdbc.datasource.DataSourceTransactionManager | Participating in existing transaction
2020-01-11 11:13:47.838 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | com.framework.code.mapper.doctor.RUserMapper.selectByExample | ooo Using Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@5c225ae5 [wrapping: com.mysql.jdbc.JDBC4Connection@35ea154e]]
#######通过openid查询用户
2020-01-11 11:13:47.838 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | com.framework.code.mapper.doctor.RUserMapper.selectByExample | ==>  Preparing: select 'true' as QUERYID, Id_, VxHeadUrl_, VxNickName_, VxSex_, VxOpenid_, VxProvince_, VxCity_, VxCountry_, Type_, PromotionSource_ from r_user WHERE ( VxOpenid_ = ? )
2020-01-11 11:13:47.839 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | com.framework.code.mapper.doctor.RUserMapper.selectByExample | ==> Parameters: oMGuv5uRcp03ycIgyjclwpZfr1Eg(String)
##########使用当前事务35ea154e
2020-01-11 11:13:47.842 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | com.framework.code.mapper.report.RPatientMapper.selectByExample | ooo Using Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@5c225ae5 [wrapping: com.mysql.jdbc.JDBC4Connection@35ea154e]]
#######根据用户Id查询患者信息
2020-01-11 11:13:47.842 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | com.framework.code.mapper.report.RPatientMapper.selectByExample | ==>  Preparing: select 'true' as QUERYID, Id_, RUserId_, RegisterTime_, Name_, Phone_, CardNo_, Age_, Illness_, Irritability_, Inheritance_, IsBindFinished_, Sex_, VxHeadUrl_, PfksShopUserId_ from r_patient WHERE ( RUserId_ = ? )
2020-01-11 11:13:47.843 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | com.framework.code.mapper.report.RPatientMapper.selectByExample | ==> Parameters: 458690345937539120(Long)
#############这里表示使用AOP调用其他的事务,判断当前有事务,那么默认直接使用当前事务
2020-01-11 11:13:47.844 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | org.springframework.jdbc.datasource.DataSourceTransactionManager | Participating in existing transaction
############继续使用当前事务    35ea154e
2020-01-11 11:13:47.845 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | com.framework.code.mapper.doctor.RDoctorMapper.selectByExample | ooo Using Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@5c225ae5 [wrapping: com.mysql.jdbc.JDBC4Connection@35ea154e]]
#######通过医生Id查询医生信息
2020-01-11 11:13:47.845 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | com.framework.code.mapper.doctor.RDoctorMapper.selectByExample | ==>  Preparing: select 'true' as QUERYID, Id_, RUserId_, Name_, NamePY_, RHospitalId_, RDepartmentId_, PositionCode_, Phone_, RegisterTime_, CheckStatus_, CheckTime_, CheckUserName_, CheckRemark_, Speciality_, Profile_, VxHeadUrl_, Dtype_, PfksShopUserId_, RDocCareType_ from r_doctor WHERE ( Id_ = ? )
2020-01-11 11:13:47.846 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | com.framework.code.mapper.doctor.RDoctorMapper.selectByExample | ==> Parameters: 463413442003472478(Long)#############再次使用AOP调用其他的事务,判断当前有事务,那么默认使用当前事务
2020-01-11 11:13:47.849 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | org.springframework.jdbc.datasource.DataSourceTransactionManager | Participating in existing transaction
#########继续使用当前事务   35ea154e
2020-01-11 11:13:47.851 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | com.framework.code.mapper.report.RReportMapper.selectByExample | ooo Using Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@5c225ae5 [wrapping: com.mysql.jdbc.JDBC4Connection@35ea154e]]#########通过医生ID和患者的ID查询医患报道表的信息
2020-01-11 11:13:47.852 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | com.framework.code.mapper.report.RReportMapper.selectByExample | ==>  Preparing: select 'true' as QUERYID, Id_, RPatientId_, RDoctorId_, CreateTime_, IMSessionId_, IllnessName_, RDoctorNameRemark_, RPatientNameRemark_ from r_report WHERE ( RDoctorId_ = ? and RPatientId_ = ? )
2020-01-11 11:13:47.853 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | com.framework.code.mapper.report.RReportMapper.selectByExample | ==> Parameters: 463413442003472478(Long), 458690345958510641(Long)
##############继续使用当前事务  35ea154e
2020-01-11 11:13:47.854 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | com.framework.code.mapper.report.RReportMapper.insert | ooo Using Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@5c225ae5 [wrapping: com.mysql.jdbc.JDBC4Connection@35ea154e]]
#############添加医患报道表的一条记录       患者ID=458690345958510641    IMSessionId_是null
2020-01-11 11:13:47.857 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | com.framework.code.mapper.report.RReportMapper.insert | ==>  Preparing: insert into r_report (Id_, RPatientId_, RDoctorId_, CreateTime_, IMSessionId_, IllnessName_, RDoctorNameRemark_, RPatientNameRemark_) values (?, ?, ?, ?, ?, ?, ?, ?)
2020-01-11 11:13:47.858 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | com.framework.code.mapper.report.RReportMapper.insert | ==> Parameters: 481834561777569793(Long), 458690345958510641(Long), 463413442003472478(Long), 2020-01-11 11:13:47.853(Timestamp), null, null, null, null###########这里输出的日志
2020-01-11 11:13:47.861 | myHost | INFO  | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | com.framework.code.service.report.RReportService | new report generate:{"id":481834561777569793,"rpatientid":458690345958510641,"rdoctorid":463413442003472478,"createtime":1578712427853,"imsessionid":null,"illnessname":null,"rdoctornameremark":null,"rpatientnameremark":null}########提交启动的事务
2020-01-11 11:13:47.861 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | org.springframework.jdbc.datasource.DataSourceTransactionManager | Initiating transaction commit#########这里我们又需要创建一个新的事务        7fb1091a        线程编号pool-1-thread-7
2020-01-11 11:13:47.861 | myHost | DEBUG | pool-1-thread-7 | [] | org.springframework.jdbc.datasource.DataSourceTransactionManager | Creating new transaction with name [com.framework.code.service.report.RPatientService.registerEvent]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT########之前线程的事务进行提交
2020-01-11 11:13:47.861 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | org.springframework.jdbc.datasource.DataSourceTransactionManager | Committing JDBC transaction on Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@5c225ae5 [wrapping: com.mysql.jdbc.JDBC4Connection@35ea154e]]################这里是我们新的事务          7fb1091a
2020-01-11 11:13:47.862 | myHost | DEBUG | pool-1-thread-7 | [] | org.springframework.jdbc.datasource.DataSourceTransactionManager | Acquired Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@75935acf [wrapping: com.mysql.jdbc.JDBC4Connection@7fb1091a]] for JDBC transaction
2020-01-11 11:13:47.862 | myHost | DEBUG | pool-1-thread-7 | [] | org.springframework.jdbc.datasource.DataSourceTransactionManager | Switching JDBC Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@75935acf [wrapping: com.mysql.jdbc.JDBC4Connection@7fb1091a]] to manual commit######这里是日志输出
2020-01-11 11:13:47.862 | myHost | INFO  | pool-1-thread-7 | [] | com.framework.code.service.report.RPatientService | [PatientEvent]:{"rUserId":458690345937539120,"rDoctorId":463413442003472478}##########使用当前事务
2020-01-11 11:13:47.862 | myHost | DEBUG | pool-1-thread-7 | [] | com.framework.code.mapper.doctor.RUserMapper.selectByPrimaryKey | ooo Using Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@75935acf [wrapping: com.mysql.jdbc.JDBC4Connection@7fb1091a]]##########通过用户Id查询用户信息
2020-01-11 11:13:47.862 | myHost | DEBUG | pool-1-thread-7 | [] | com.framework.code.mapper.doctor.RUserMapper.selectByPrimaryKey | ==>  Preparing: select Id_, VxHeadUrl_, VxNickName_, VxSex_, VxOpenid_, VxProvince_, VxCity_, VxCountry_, Type_, PromotionSource_ from r_user where Id_ = ?
2020-01-11 11:13:47.863 | myHost | DEBUG | pool-1-thread-7 | [] | com.framework.code.mapper.doctor.RUserMapper.selectByPrimaryKey | ==> Parameters: 458690345937539120(Long)######之前的线程释放JDBC连接
2020-01-11 11:13:47.867 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | org.springframework.jdbc.datasource.DataSourceTransactionManager | Releasing JDBC Connection
[com.mchange.v2.c3p0.impl.NewProxyConnection@5c225ae5 [wrapping: com.mysql.jdbc.JDBC4Connection@35ea154e]] after transaction
2020-01-11 11:13:47.867 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | org.springframework.jdbc.datasource.DataSourceUtils | Returning JDBC Connection to DataSource
2020-01-11 11:13:47.867 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | org.springframework.web.servlet.DispatcherServlet | Completed 200 OK####被AOP的切面拦截输入的日志
2020-01-11 11:13:47.867 | myHost | INFO  | pool-1-thread-8 | [] | com.framework.web.eventbus.LogSubscribe | [LogSubscribe]:{"threadName":"http-nio-8081-exec-10","className":"com.framework.code.controller.webchat.WeChartController","methodName":"receiveEvent","argsMap":{"request":"ServletRequest","response":"ServletResponse"},"argsJson":"{\"request\":\"ServletRequest\",\"response\":\"ServletResponse\"}","happenTime":1578712427867,"throwable":null,"throwableString":null,"traceId":"436ed24f998d411ab5150b1258b22cd0","result":null,"useTime":33}2020-01-11 11:13:47.867 | myHost | DEBUG | http-nio-8081-exec-10 | [436ed24f998d411ab5150b1258b22cd0] | org.springframework.session.web.http.SessionRepositoryFilter.SESSION_LOGGER | No session found by id: Caching result for getSession(false) for this HttpServletRequest.########使用当前事务          7fb1091a
2020-01-11 11:13:47.867 | myHost | DEBUG | pool-1-thread-7 | [] | com.framework.code.mapper.report.RPatientMapper.selectByExample | ooo Using Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@75935acf [wrapping: com.mysql.jdbc.JDBC4Connection@7fb1091a]]###通过用户ID查询患者信息
2020-01-11 11:13:47.867 | myHost | DEBUG | pool-1-thread-7 | [] | com.framework.code.mapper.report.RPatientMapper.selectByExample | ==>  Preparing: select 'true' as QUERYID, Id_, RUserId_, RegisterTime_, Name_, Phone_, CardNo_, Age_, Illness_, Irritability_, Inheritance_, IsBindFinished_, Sex_, VxHeadUrl_, PfksShopUserId_ from r_patient WHERE ( RUserId_ = ? )
2020-01-11 11:13:47.869 | myHost | DEBUG | pool-1-thread-7 | [] | com.framework.code.mapper.report.RPatientMapper.selectByExample | ==> Parameters: 458690345937539120(Long)##########使用AOP调用其他的事务,判断当前有事务,那么默认使用当前事务        7fb1091a
2020-01-11 11:13:47.870 | myHost | DEBUG | pool-1-thread-7 | [] | org.springframework.jdbc.datasource.DataSourceTransactionManager | Participating in existing transaction
2020-01-11 11:13:47.876 | myHost | DEBUG | pool-1-thread-7 | [] | com.framework.code.mapper.report.RPatientMapper.selectByPrimaryKey | ooo Using Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@75935acf [wrapping: com.mysql.jdbc.JDBC4Connection@7fb1091a]]######通过用户ID查询患者信息
2020-01-11 11:13:47.876 | myHost | DEBUG | pool-1-thread-7 | [] | com.framework.code.mapper.report.RPatientMapper.selectByPrimaryKey | ==>  Preparing: select Id_, RUserId_, RegisterTime_, Name_, Phone_, CardNo_, Age_, Illness_, Irritability_, Inheritance_, IsBindFinished_, Sex_, VxHeadUrl_, PfksShopUserId_ from r_patient where Id_ = ?
2020-01-11 11:13:47.876 | myHost | DEBUG | pool-1-thread-7 | [] | com.framework.code.mapper.report.RPatientMapper.selectByPrimaryKey | ==> Parameters: 458690345958510641(Long)##########使用当前事务        7fb1091a
2020-01-11 11:13:47.878 | myHost | DEBUG | pool-1-thread-7 | [] | com.framework.code.mapper.report.RReportMapper.selectByExample | ooo Using Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@75935acf [wrapping: com.mysql.jdbc.JDBC4Connection@7fb1091a]]
##########通过患者ID查询患者报道信息表       458690345958510641
2020-01-11 11:13:47.878 | myHost | DEBUG | pool-1-thread-7 | [] | com.framework.code.mapper.report.RReportMapper.selectByExample | ==>  Preparing: select 'true' as QUERYID, Id_, RPatientId_, RDoctorId_, CreateTime_, IMSessionId_, IllnessName_, RDoctorNameRemark_, RPatientNameRemark_ from r_report WHERE ( RPatientId_ = ? and IMSessionId_ is null )
2020-01-11 11:13:47.878 | myHost | DEBUG | pool-1-thread-7 | [] | com.framework.code.mapper.report.RReportMapper.selectByExample | ==> Parameters: 458690345958510641(Long)########输出查询结果
2020-01-11 11:13:47.879 | myHost | INFO  | pool-1-thread-7 | [] | com.framework.code.service.report.RReportService | 查询隐患报道关系.数量只能有一条:0记录信息=[]

看完日志 我们不难发现,在主线程明明已经执行完成新增操作,并且已经释放了JDBC连接,在EventBus的线程中新的事务中并没有查询到我们要插入的数据。。。。

按照正常的逻辑思考这就是一个死循环的。。。。。。明明我已经执行完成了新增操作并且释放了连接到连接池 。。问什么我在新的事务中查询不到数据呢。

个人的分析可能数据库出来也许一个短暂 的时间,因为主线程插入数据的时间和EventBus线程去查询间隔时间只有0.02秒的时间可能数据并没有写入完成操作的。我的解决方案就是放弃EventBus使用主线程一次处理所有业务,让一次接口调用的响应时间加长,来减少并发出现的问题。

项目遇到的多线程的并发问题和分析相关推荐

  1. JAVA多线程和并发基础面试问答

    点击上方"方志朋",选择"设为星标" 回复"666"获取新整理的面试文章 多线程和并发问题是Java技术面试中面试官比较喜欢问的问题之一.在 ...

  2. java书籍_还搞不定Java多线程和并发编程面试题?你可能需要这一份书单!

    点击蓝色"程序员书单"关注我哟 加个"星标",每天带你读好书! ​ 在介绍本书单之前,我想先问一下各位读者,你们之前对于Java并发编程的了解有多少呢.经过了1 ...

  3. CPU,多核,多线程,并发,并行,计算效率

    计算机原理:CPU.并发.并行.多核.多线程.多进程 0.计算机工作流程 0.0 基础概念:计算机组成 0.1 CPU(Central Processing Unit) (1)控制单元 (2)运算单元 ...

  4. SpringBoot实战实现分布式锁一之重现多线程高并发场景

    实战前言:上篇博文我总体介绍了我这套视频课程:"SpringBoot实战实现分布式锁" 总体涉及的内容,从本篇文章开始,我将开始介绍其中涉及到的相关知识要点,感兴趣的小伙伴可以关注 ...

  5. Java多线程与并发库高级应用架构

    张孝祥_Java多线程与并发库高级应用 [视频介绍:] Java线程是一项非常基本和重要的技术,在偏底层和偏技术的Java程序中不可避免地要使用到Java线程技术,特别是android手机程序和游戏开 ...

  6. Java多线程和并发问题集

    并发是指什么 并发是程序同时执行多个计算的能力. 这可以通过将计算分布在机器的可用CPU内核上(多核CPU支持)或甚至通过同一网络内的不同机器来实现(后台分布式). 进程和线程有什么区别 进程是操作系 ...

  7. Java设计思想深究----多线程与并发(图文)

    本文很长很长,对原理深入至内存层面,以顺序结构讲述集合框架的设计故事,请耐心阅读顺序阅读 或 挑选疑惑点阅读. 目录结构太大,导致点击后索引到内容末尾,需要查看上滑或下滑即可. 目录 一切的缘起是昂贵 ...

  8. linux线程池实现多线程并发,基于Linux的多线程池并发Web服务器设计-电子设计工程.PDF...

    基于Linux的多线程池并发Web服务器设计-电子设计工程.PDF 第 卷 第 期 电子设计工程 年 月 基于 的多线程池并发 服务器设计 陈 涛 任海兰 武汉邮电科学研究院 湖北 武汉 摘要 时至今 ...

  9. ***JAVA多线程和并发基础面试问答

    多线程和并发问题是Java技术面试中面试官比较喜欢问的问题之一.在这里,从面试的角度列出了大部分重要的问题,但是你仍然应该牢固的掌握Java多线程基础知识来对应日后碰到的问题.(校对注:非常赞同这个观 ...

最新文章

  1. Android笔记(adb命令--reboot loader)
  2. 关于授予81项成果2019年度“吴文俊人工智能科学技术奖”的决定
  3. Windows Phone实用开发技巧(1):保存图片及加载图片
  4. 善用rel=’canonical’,权重更集中(转)
  5. 数据挖掘应用的一些场景和对应算法
  6. (转)mybatis热部署加载*Mapper.xml文件,手动刷新*Mapper.xml文件
  7. flask.Blueprint
  8. RN和React路由详解及对比
  9. Android动态切换主题
  10. CCF201403试题
  11. 相机模型与标定(二)--相机模型
  12. Android进阶2之oauth认证中UC无法跳转的问题
  13. laravel nginx_在nginx上用FastCGI解析PHP
  14. springCloud 2020.x 版本变化,移除eureka以外的Netflix组件
  15. Ureport2 ---报表设计(2)--报表计算模型
  16. 领悟书生写论坛之类图设计
  17. 连续两次入围Gartner魔力象限的Quick BI到底有何魔力?
  18. 根据年份和月份来计算天数
  19. 最新WiFi标准—WiFi 7
  20. 主流新产品开发模式介绍:集成产品开发管理

热门文章

  1. MDPI期刊的latex模板使用bib快速导入参考文献(TeXstudio)一个更快更简单的方法!
  2. 织梦js广告不显示原因,dedecms后台不显示广告预览(最新2016年2月29日)
  3. 敏捷开发是一种以人为核心、迭代、循序渐进的开发方法
  4. 淘宝:消息中间件——notify
  5. 全国42个城市地铁站点数据集合(2021年)
  6. android studio怎么改软件扫码界面_Android测试工具入门介绍(二)
  7. js 字符串截取方法总结(前端)
  8. Windows支持诊断工具(MSDT)远程代码执行漏洞(CVE-2022-30190)分析复现/修复
  9. php房产cms,易居cms房产网站系统 v0120 体验版
  10. 怎么查看计算机当前用户和组,如何查看电脑硬盘的ID号与详细信息-电脑自学网...