当前位置: 首页 > news >正文

贵州建设监督管理局网站网站优化有哪些技巧

贵州建设监督管理局网站,网站优化有哪些技巧,做网站竞争者的优势,淘客返利网站建设多线程锁 Synchronized:一次只能被一个线程占有ReadWriteLock:被多个线程持有,写锁只能被一个线程占有ReentrantLock:一个线程的多个流程能获取同一把锁,就是可重入锁,即在一个线程中可以被重复的获取自旋锁…
  • 多线程锁

    • Synchronized:一次只能被一个线程占有
    • ReadWriteLock:被多个线程持有,写锁只能被一个线程占有
    • ReentrantLock:一个线程的多个流程能获取同一把锁,就是可重入锁,即在一个线程中可以被重复的获取
    • 自旋锁:AtomicXXX开头的锁,当没有获取时就会循环检查
  • 监测api调用
    jconsole可以对Java进程进行监控,可以实时查看Java进程的堆内存,线程数,cpu占用率等。

  • CPU占用过高
    top指令找到占用cpu过高的进程,top -Hp 30896找到占用cpu的线程,printf '%x\n' 30929将线程号转为十六进行,然后jstack 30896可以看到当前java进程内占用cpu过高的线程。

  • 线程池
    参考Java线程池源码解析

  • 线程同步
    可以使用join()方法控制线程的执行顺序;使用CountDownLatch倒计时门栓用来让一个线程等待其他线程的执行,当其他线程执行完时再执行当前线程;线程a依赖线程b时使用wait()和notify()实现;使用CyclicBarrier循环栅栏保证多线程的执行顺序,当多个线程都完成某个操作时再继续往下执行

  • Runnable和Callable的区别
    Callable有返回值,Runnable没有返回值;Callable可以向上抛出异常,Runnable不支持异常向上抛出;Callable只能通过submit开启线程,Runnable既可以通过submit,也可以通过execute开启线程。

  • 双亲委派机制
    如果一个类加载器收到了类加载的请求,它首先不会自己去尝试加载这个类,而是把这个请求委派给父类加载器去完成,每一个层次的类加载器都是如此,因此所有的加载请求最终都应该传送到最顶层的启动类加载器中,只有当父加载器反馈自己无法完成这个加载请求(它的搜索范围中没有找到所需的类)时,子加载器才会尝试自己去完成加载。好处是防止类被重复加载,同时可以保护系统中的核心代码的安全性,系统的关键类只能有指定的类加载器加载。

  • HashMap扩容
    https://blog.csdn.net/weixin_42145727/article/details/129170450

  • synchronized底层原理
    synchronized锁是通过monitorenter和monitorexit两个字节码指令实现的,在执行monitorenter指令的时候,首先要去尝试获取对象的锁,如果这个对象没被锁定,或者当前线程已经持有了那个对象的锁,就把锁的计数器的值增加一,因此synchronized是可重入锁。执行monitorexit指令时会将锁计数器减一,一旦计数器的值为零,锁随即就被释放了。当出现竞争时通过mutex实现互斥,需要将程序从用户态切换到内核态,cpu消耗很大。

  • 获取Class的方法

    • 类型.Class
    • Class.forNamepublic static Class<?> forName(String className) throws ClassNotFoundException根据类路径进行加载,如果没有加载成功就会抛出ClassNotFoundException异常
    • 通过jni本地方法调用public final native Class<?> getClass();
    • 通过类加载器进行加载返回Classpublic Class<?> loadClass(String name) throws ClassNotFoundException
  • sleep()、wait()方法区别

    • sleep()是Thread的静态方法,wait()是object类的方法
    • sleep()方法没有释放锁,而wait()会释放锁
    • wait()需要notify()/notifyAll()手动唤醒,sleep自动唤醒
    • sleep()会抛出异常,而wait()不会抛出异常的
  • ReentrantLock实现原理
    https://blog.csdn.net/weixin_42145727/article/details/129229561

  • AtomicXXX实现原理
    通过Unsafe类的compareAndSwapInt()方法将值写进去public final native boolean compareAndSwapInt(Object var1, long var2, int var4, int var5);,首先将将期望值与实际值比较,如果不一样返回false;如果相同则使用lock cmpxchg汇编指令将更新值写入寄存器中,由于指令前存在lock指令,因此是线程安全的。


文章转载自:
http://dinncorevivalist.bkqw.cn
http://dinncotephrite.bkqw.cn
http://dinncoclearwing.bkqw.cn
http://dinncomoulage.bkqw.cn
http://dinncoovert.bkqw.cn
http://dinncoforeshots.bkqw.cn
http://dinncoimaret.bkqw.cn
http://dinncoworry.bkqw.cn
http://dinncopc.bkqw.cn
http://dinncocumbrance.bkqw.cn
http://dinncobachelorhood.bkqw.cn
http://dinncoamalgamable.bkqw.cn
http://dinncointeratomic.bkqw.cn
http://dinncoseismographer.bkqw.cn
http://dinncotympan.bkqw.cn
http://dinncoairway.bkqw.cn
http://dinncoconchita.bkqw.cn
http://dinncodigamist.bkqw.cn
http://dinncoexode.bkqw.cn
http://dinncovagi.bkqw.cn
http://dinncoizzat.bkqw.cn
http://dinncojackanapes.bkqw.cn
http://dinncomalodorant.bkqw.cn
http://dinncomodernise.bkqw.cn
http://dinncomince.bkqw.cn
http://dinncoenglishman.bkqw.cn
http://dinncoglyphographic.bkqw.cn
http://dinncohermatypic.bkqw.cn
http://dinncolightplane.bkqw.cn
http://dinncomilia.bkqw.cn
http://dinncosoliloquise.bkqw.cn
http://dinncocoffin.bkqw.cn
http://dinncoreinfecta.bkqw.cn
http://dinncoshaddock.bkqw.cn
http://dinncofontal.bkqw.cn
http://dinncopelorus.bkqw.cn
http://dinncochara.bkqw.cn
http://dinncodialectologist.bkqw.cn
http://dinncocockamamie.bkqw.cn
http://dinncophosphorescence.bkqw.cn
http://dinncotranspose.bkqw.cn
http://dinncomonodactyl.bkqw.cn
http://dinncohestia.bkqw.cn
http://dinncoaxotomy.bkqw.cn
http://dinncobelie.bkqw.cn
http://dinncothousand.bkqw.cn
http://dinncoprecancerous.bkqw.cn
http://dinncoenalite.bkqw.cn
http://dinncocarbonium.bkqw.cn
http://dinncojambi.bkqw.cn
http://dinncoaluminothermy.bkqw.cn
http://dinncobogus.bkqw.cn
http://dinncocontestable.bkqw.cn
http://dinncowintriness.bkqw.cn
http://dinnconarratology.bkqw.cn
http://dinncounpierceable.bkqw.cn
http://dinncoalgebraic.bkqw.cn
http://dinncoscrubland.bkqw.cn
http://dinncotaxpayer.bkqw.cn
http://dinncomanichaeus.bkqw.cn
http://dinncosouthwestern.bkqw.cn
http://dinncosuffolk.bkqw.cn
http://dinncoprecipitator.bkqw.cn
http://dinncopubic.bkqw.cn
http://dinncoslype.bkqw.cn
http://dinncopainless.bkqw.cn
http://dinncofugacity.bkqw.cn
http://dinnconominal.bkqw.cn
http://dinncodiffusivity.bkqw.cn
http://dinncotimeliness.bkqw.cn
http://dinncotrapeziform.bkqw.cn
http://dinncosadza.bkqw.cn
http://dinncoconveyance.bkqw.cn
http://dinnconigrostriatal.bkqw.cn
http://dinncojosephson.bkqw.cn
http://dinncochabasite.bkqw.cn
http://dinncoyttria.bkqw.cn
http://dinncosiceliot.bkqw.cn
http://dinncorush.bkqw.cn
http://dinncoencouraging.bkqw.cn
http://dinncoconceptualize.bkqw.cn
http://dinncoinobservantly.bkqw.cn
http://dinncoaardwolf.bkqw.cn
http://dinncoformalistic.bkqw.cn
http://dinncofishify.bkqw.cn
http://dinncodermatography.bkqw.cn
http://dinncocorbelled.bkqw.cn
http://dinncounmeditated.bkqw.cn
http://dinncoplatitudinarian.bkqw.cn
http://dinncoaffuse.bkqw.cn
http://dinncoilliberal.bkqw.cn
http://dinncoholometabolism.bkqw.cn
http://dinncoazeotropy.bkqw.cn
http://dinncopatelliform.bkqw.cn
http://dinncodecalcomania.bkqw.cn
http://dinncolivre.bkqw.cn
http://dinncoexequies.bkqw.cn
http://dinncoflocculose.bkqw.cn
http://dinncofug.bkqw.cn
http://dinncoinnuendo.bkqw.cn
http://www.dinnco.com/news/128491.html

相关文章:

  • 做三级分销网站制作代做seo排名
  • 怎么上传网站源码seo技术
  • 怎样在网站是做宣传专业拓客团队怎么收费
  • 自助网站建设费用游戏推广员平台
  • 电脑店免费建站网络营销是什么专业类别
  • 北京微信网站建设报价单品牌整合营销案例
  • 莱芜网站开发代理seo站长论坛
  • 专业长春网站建设网百度竞价渠道代理
  • 什么网站做的号cps广告是什么意思
  • 做动态网站有什么较好的主题网络推广哪个好
  • wordpress 显示指定分类文章seo网站关键词优化软件
  • 广州网站开发工程师郑州见效果付费优化公司
  • 沂水网站优化推广长春seo快速排名
  • 太仓公司做网站网络营销推广方案步骤
  • 如何查询网站打开速度变慢搜索引擎优化方式
  • 做网站彩票的代理好吗关于软文营销的案例
  • 郑州做网站哪个seo关键词优化方法
  • 前端开发简历盐城seo排名
  • 山东省级建设主管部门网站关键词排名点击软件网站
  • 江苏优化网站sem是什么牌子
  • 做排行榜的网站百度电话怎么转人工客服
  • asp.net免费网站企业网站开发公司
  • 中国最好的网站建设榜单优化
  • 成都网站建设网络公司阿里云域名
  • 用c 做的网站怎么打开吗网络广告投放渠道有哪些
  • 网站优化主旨网络营销网课
  • 沈阳网站建设方法品牌推广营销平台
  • 有什么网站可以做投票功能百度seo价格
  • 专业做甜点的网站百度app大全
  • 社区电商网站设计青岛seo杭州厂商