Posts

Showing posts from April, 2018

Xcode Shortcut

Image

Thread & Locks

Image
Threads Threads are subunits of processes, which can be scheduled independently by the operating system scheduler. Multiple threads can be executed at the same time on a single CPU core. The operating system assigns small slices of computing time to each thread, so that it seems to the user as if multiple tasks are executed at the same time. If multiple CPU cores are available, then multiple threads can be executed truly in parallel. We can either use the POSIX thread API, or the Objective-C wrapper around this API, NSThread. NSThread is a simple Objective-C wrapper around pthreads. Grand Central Dispatch With GCD you don’t interact with threads directly anymore. Instead you add blocks of code to queues, and GCD manages a thread pool behind the scenes. GCD decides on which particular thread your code blocks are going to be executed on, and it manages these threads according to the available system resources. This alleviates the problem of too many threads being cre...

Networking

Image
DNS Server On a typical small or home network, the DNS server IP addresses are often the same as the default gateway address. Devices send their DNS queries to your router, which then forwards the requests on to whatever DNS servers the router is configured to use. https://www.cyberciti.biz/faq/how-to-find-out-dns-for-router/ PING ping operates by sending  Internet Control Message Protocol  (ICMP) echo request  packets  to the target host and waiting for an ICMP echo reply. The program reports errors,  packet loss , and a statistical summary of the results, typically including the minimum, maximum, the  mean  round-trip times, and  standard deviation  of the mean. ping requests host if it is alive and print required time to get a response from that host server. ping www.google.com check dns server nslookup www.google.com host  www.google.com To view dns traffic run tcpudmp as root # tcpdump udp and src port...