未分类

用进程资源图检测死锁的原理

用进程资源图检测死锁的步骤为:

  1. 确认系统剩余资源数,确认非阻塞进程;
  2. 去掉非阻塞进程的所有边,现成一个孤立的点,再将分配给该进程的资源回收;
  3. 查看剩余非阻塞进程,重复执行步骤2;
  4. 最终,所有的资源和进程都变成孤立的点,这样的图叫做“可完全简化”。

如果一个图可完全简化,则不会产生死锁。如果一个图不可完全简化,则会产生死锁。

举例:

阅读更多

如何免费使用Google Cloud的高性能GPU进行AI训练,做AIGC

最近在搞AIGC相关的东西,各个平台的用了一下,发现还是开源香啊!刚好手上有台配置不错的PC,显卡1080Ti(当年的骨灰级显卡)11GB的显存,跑了一下Stable Diffusion,还行!比大多数付费的搭载SD的服务器都好用。

但性能还是不行,不如专门的搞AI的图形显卡性能好,这就想起了当年用GCP的GPU挖ETH的经历,于是又捡起来了,搭建了Stable Diffusion服务器,性能杠杠的!15GB显存的GPU~

算了,有机会再写吧~~~

话说这些模型生成的图片质量越来越高了!

dump Java Thread 的几种状态及其含义

The values of the Java thread state and the internal VM thread state can be:

  • R – Runnable – the thread is able to run when given the chance.
  • CW – Condition Wait – the thread is waiting. For example, because:
    • The thread has been blocked for I/O
    • A wait() method is called to wait on a monitor being notified
    • The thread is synchronizing with another thread with a join() call
  • S – Suspended – the thread has been suspended by another thread.
  • Z – Zombie – the thread has been killed.
  • P – Parked – the thread has been parked by the new concurrency API (java.util.concurrent).
  • B – Blocked – the thread is waiting to obtain a lock that something else currently owns.