Bytecode level 0x0020 [synchronized] will be added to the method flag. Specifically used are monitorenter and monitorexit 0 load_0 1 dup 2 astore_1 3 monitorenter 4 aload_1 5 monitorexit 6 goto 14 (+ 8) 9 astore_2 10 aload_1 11 monitorexit 12 aload_2 13 throw 14 return Why are there two monitorexits? In addition to normal […]
Tag: chr
“GitHub Project Circle 01” A project to build an AI digital human is open source! Automatically realize audio and video synchronization!
Starting this week, Xiaoquan officially launches the “GitHub Project Selection Weekly” plan, which selects some fun, interesting, practical, and advanced open source projects that Xiaoquan has encountered or recommended by big players in the industry, and shares them in the form of weekly articles. For everyone to watch and learn, hoping to learn and make […]
[Resolved] RuntimeError: CUDA error: device-side assert triggeredCUDA kernel errors might be asynchronous
Problem description The specific error message is ./aten/src/ATen/native/cuda/Loss.cu:240: nll_loss_forward_reduce_cuda_kernel_2d: block: [0,0,0], thread: [0,0,0] Assertion `t >= 0 & amp; & amp ; t < n_classes` failed. ../aten/src/ATen/native/cuda/Loss.cu:240: nll_loss_forward_reduce_cuda_kernel_2d: block: [0,0,0], thread: [1,0,0] Assertion `t >= 0 & amp; & amp; t < n_classes` failed. ../aten/src/ATen/native/cuda/Loss.cu:240: nll_loss_forward_reduce_cuda_kernel_2d: block: [0,0,0], thread: [2,0,0] Assertion `t >= 0 & […]
Android: OkHttp synchronous request and asynchronous request
1. Foreword In my previous work on network requests, I used post requests. After learning about them, I found that there are many types of requests. The following focuses on the synchronous requests and asynchronous requests of get and post. 2. Specific content 1. Characteristics of Okhttp: Supports HTTP/2 and allows all requests to the […]
[Linux Programming] Five IO models of Linux: blocking IO, non-blocking IO, IO multiplexing, signal-driven IO and asynchronous IO
The Linux IO model refers to the way in which user processes and the kernel perform input and output operations in a Linux system. Input and output operations usually involve the transmission and copying of data. These operations consume system resources and time. Therefore, choosing an appropriate IO model is very important to improve the […]
10-Asynchronous programming (concurrent, parallel, synchronous, asynchronous, blocking, non-blocking), synchronous blocking, asynchronous blocking, synchronous non-blocking, asynchronous non-blocking
1 concurrent 2 parallel 3 sync 4 asynchronous 5 blocking 6 non-blocking 6.1 Synchronous blocking, asynchronous blocking, synchronous non-blocking, asynchronous non-blocking 7 Asynchronous Programming 1 concurrent 1 Concurrency describes the organizational structure of the program. It means that the program should be designed into multiple subtasks that can be executed independently. 2 The purpose is […]
Asynchronously send logs to remote server in Python
background The most common way to use logs in Python is to output logs in the console and files. The logging module also provides corresponding classes that are very convenient to use. However, sometimes we may have some needs, such as How to achieve this requirement by sending logs to the remote end or directly […]
JavaScriptAsynchronous operation
Article directory Callbacks Promise Async/Await – more recommended In JavaScript, you can use asynchronous operations to handle code that needs to wait for some operation to complete before continuing. Asynchronous operations can help us avoid blocking the main thread and improve program performance and responsiveness when making network requests, reading and writing files, processing large […]
Thread condition control realizes thread synchronization
I talked about mutex locks earlier, but I always feel that some functional mutex locks are not enough. Condition variables are another synchronization mechanism available for threads. Condition variables provide a place for multiple threads to meet. Condition variables, when used with mutexes, allow threads to wait for a specific condition to occur in a […]
synchronized optimization principle
Article directory 1. Underlying principles 2. Optimization plan one: lightweight lock (1) Lightweight lock workflow (2) Lock expansion 3. Optimization plan two: spin optimization 4. Optimization plan three: bias lock (1) Biased state (2) Batch weight bias (3) Batch re-direction cancellation 5. Optimization plan four: lock elimination 1. Underlying principles First of all, we need […]