码迷,mamicode.com
首页 >  
搜索关键字:thread safety    ( 13653个结果
线程通信-全局变量-标准库threading
from threading import Thread from time import sleep a = 1 def foo(): global a a = 1000 def bar(): sleep(1) print("a = ",a) t1 = Thread(target = foo) t ...
分类:编程语言   时间:2021-01-13 10:50:50    阅读次数:0
理解 Java Thread ContextClassLoader(线程上下文类加载器)
为什么需要ContextClassLoader Java中的类加载机制是双亲委派模型,即按照AppClassLoader → SystemClassLoader → BootstrapClassLoader 的顺序,子ClassLoader将一个类加载的任务委托给父ClassLoader(父Clas ...
分类:编程语言   时间:2021-01-08 11:29:55    阅读次数:0
Java多线程编程核心技术
1 Java多线程技能 本章主要介绍线程和进程的相关概念,多线程的实现和停止,以及Thread类中的核心方法。 [TOC] 1.1 进程和线程 1.进程 一个可并发执行的具有独立功能的程序关于某个数据集合的一次执行过程,也是操作系统进行资源分配和保护的基本单位。 简单的说,进程就是一个程序的一次执行 ...
分类:编程语言   时间:2021-01-06 11:48:16    阅读次数:0
C# 定时关机代码
c#定时关机代码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; usin ...
分类:Windows程序   时间:2021-01-02 11:04:09    阅读次数:0
【JAVA基础&Python】多线程使用
JAVA:/* * * 1:定义一个继承Thread的类,里面定义run函数为需要多线程的业务函数 * 2:实例化重写的这个类,执行start方法进行多线程运行 * * */ class MyThread extends Thread{ // 多线程 需要执行的方法 @Override public ...
分类:编程语言   时间:2021-01-02 10:54:28    阅读次数:0
图片下载的两种方式Thread和Callable
图片下载 //练习Thread,实现多线程同步下载图片 public class ThreadTest2 extends Thread{ private String url; private String name; public ThreadTest2(String url,String nam ...
分类:其他好文   时间:2021-01-02 10:53:02    阅读次数:0
How Arc works in Rust
The Atomic Reference Counter (Arc) type is a smart pointer that lets you share immutable data across threads in a thread-safe way. I couldn’t find any ...
分类:其他好文   时间:2021-01-01 12:32:52    阅读次数:0
condition
#include <deque> #include <thread> #include <mutex> #include <condition_variable> using namespace std; deque<int> queue; mutex mtx; condition_variable ...
分类:其他好文   时间:2020-12-31 12:12:20    阅读次数:0
多线程与多进程pid的比较
code from threading import Thread from multiprocessing import Process import os def work(name): print('{}的pid是'.format(name), os.getpid()) if __name__ ...
分类:编程语言   时间:2020-12-31 12:09:31    阅读次数:0
获取线程的执行结果
code import threading from queue import Queue import time def timeit(f): def wrapper(*args, **kwargs): start_time = time.time() res = f(*args, **kwarg ...
分类:编程语言   时间:2020-12-31 11:57:23    阅读次数:0
13653条   上一页 1 ... 15 16 17 18 19 ... 1366 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!