线程安全队列
public class SafeQueue<T>{private int capacity10;private int size,tail,head;private T[] queue;private Lock lock new ReentrantLock();private Condition notFull lock.newCondition();//容器不满,生产者private Condition notEmpty …
一、原题 View the Exhibit and examine the structure of the ORDERS and CUSTOMERS tables. Evaluate the following SQL command: SQL>SELECT o.order_id, c.cust_name, o.order_total, c.credit_limit FROM orders o JOIN customers c USING (custom…
1.使用synchronized悲观锁
(秋招阿里的一个笔试题,应该写的比较复杂,然后就没有然后了o(╥﹏╥)o)
public class ThreadThreadp {private int flag 0;public synchronized void printa() throws InterruptedException {while (…
在操作git切换分支的时候,遇到一个错误: Another git process seems to be running in this repository, e.g. an editor opened by git commit. Please make sure all processes are terminated then try again. If it still fails, a git process may …
一、原题 Which statements are true regarding the FOR UPDATE clause in a SELECT statement? (Choose all that apply.) A. It locks only the columns specified in the SELECT list. B. It locks the rows that satisfy the condition in the SELECT statement. C. It c…
mysql 查看表锁情况
/*
查看正在运行的进程
*/
show full processlist;/*
查看表打开情况
In_use:表示表锁或锁请求数;
Name_locked:表示表名是否被锁;
*/
show open tables where in_use >0 or name_locked >0;/*
查看服务器锁状态
*/
show GLOBAL status like %lock%;…