ming1016 / study Goto Github PK
View Code? Open in Web Editor NEW学习记录
学习记录
文章目录结构划分不够清晰,看着没有主次!
كن اسدا تأكل السباع من فضلتك و لا تكن سبعا يأكل من فضلة الأسود
for (size_t y = 0; y < height; ++y) {
for (size_t x = 0; x < width; ++x) {
// Do something with x and y here
}
}
//因为可以并行执行,所以使用dispatch_apply可以运行的更快
纠正的地方:“dispatch_apply这个是会阻塞主线程的” 改成 “dispatch_apply这个是会阻塞当前上下文线程的”
实现方法单独起一个global thread,内置一个runloop,所有的connection都由这个runloop发起,回调也是它接收,不占用主线程,也不耗CPU资源。厉害👍🏻
细说GCD(Grand Central Dispatch)如何用中
操作是在多线程上还是单线程主要是看队列的类型和执行方法,并行队列异步执行才能在多线程,并行队列同步执行就只会在主线程执行了
并行队列同步执行就只会在主线程执行了
严谨来说应该是只会在这个并行队列在队列中被分配的线程,并不一定就是主线程
例如
- (void)syncWithConcurrent{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
dispatch_queue_t queue = dispatch_queue_create("com.lennon.instance", DISPATCH_QUEUE_CONCURRENT);
dispatch_sync(queue, ^{
NSLog(@"sync:%@",[NSThread currentThread]);
});
NSLog(@"%@",[NSThread currentThread]);
});
}
输出
2017-02-22 23:52:34.946 OffscreenRendering[26214:4052707] sync:<NSThread: 0x60800007b680>{number = 3, name = (null)}
2017-02-22 23:52:34.946 OffscreenRendering[26214:4052707] <NSThread: 0x60800007b680>{number = 3, name = (null)}
i need a live broadcast platform you can do it
使用NSOperation+NSURLConnection并发模型都会面临NSURLConnection下载完成前线程退出导致NSOperation对象接收不到回调的问题? 这句话解析一下,谢谢.
是绘图板还是纸上画了拍照的?
好厉害!
smck检测无用类根本检测不出来的,检测出来的类都是有使用过的,而且检测不了swift类 这是什么原因呢
屠龙之技,膜拜大佬
https://github.com/ming1016/study/wiki/CFRunLoop
这里提到也不耗CPU资源是什么意思?
UIImage *downloadedImage = ...;
[self.avatarImageView performSelector:@selector(setImage:)
withObject:downloadedImage
afterDelay:0
inModes:@[NSDefaultRunLoopMode]];
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.