摘要:
当时写这个程序是公司要求有个测试环境测试多用户情况,我匆匆忙忙的用了个上午写完后,一测试能用,就交差了,不过后来在多次使用的时候发现了有时候程序回莫名退出,不过由于时间等原应,就没有在仔细修改了,朋友门如果有新区的话,可以自己修改一下,如果有什么想法也希望和我联系!
功能说明:可以输入需要访问的url(注意需要加"http://"才可以,我当时程序中偷懒了,......
摘要:
同步线程
同步在多线程编程的非结构化性质与同步处理的结构化次序之间提供了一个折衷的办法。
使用同步技术,可以完成以下操作: 在必须以特定顺序执行任务时,显式控制代码运行的次序。
- 或者 - 当两个线程同时共享相同的资源时,避免可能出现的问题。
例如,可以使用同步使显示过程处于等待状态,直至在另一线程中运行的数据检索过程结束。
同步的方法有两种:轮询和使用同步对象。轮询反复从循......
在.Net中监控Processes和Threads(1)
a process is an instance of a running application on a system. a process itself is nothing besides memory address space. besides the space, a process also owns resources including files, dynamic and virtual memory allocations, and threads. each process has a unique id. for a process to accomplish anything, it must own thread(s). each process has at least one main thread, and can have any number of secondary threads, also known as worker threads.
a thread is a path of execution that executes some part of code in a predefined manner. a thread executes this code in a processes address space. each thread has a unique id, and allocates its own resources such as cpu registers and stack.
in this article, we will discuss how to return all the available processes on a machine, and all the threads corresponding to a process. the sample application we develop shows the total number of running processes, their ids, and corresponding information such as physical and virtual memory, starting time, etc. this program also lets us monitor available threads, information that is not available in windows task manager.
system.diagnostics namespace
in the .net framework, the system.diagnostics namespace defines classes that allow us to debug and trace applications, read and write event logs, and monitor processes and system performance using performance counters. the major classes include debug, counter, eventlog, process, processthread, stacktrace, and trace.
a discussion of all these classes is out of the scope of this article - we will cover only the process class and its related classes.
the process class
in .net, the process class enables us to start...
下一页 摘要:
retrieving information on system resources and process information was not possible wihtout api calls in vb6. calling api functions has its own difficulties. identifying correct datatypes, ide......