monitor

Win32 code to get EDID in Windows XP/7

拈花ヽ惹草 提交于 2019-11-27 19:12:40
问题 I found this page and was unable to get any useful information out of it (it searches the registry for something but never finds it and goes into an infinite loop). As this question regarding getting the monitor serial UID ("EDID information") asks I would like the same information but from the point of view of Win32 C code (or C/C++ DDK code, or whatever) instead of Linux. 回答1: WMI didn't support monitor classes in Windows XP. The documented way of getting the EDID was - and still is - with

How to monitor a folder with all subfolders and files inside?

霸气de小男生 提交于 2019-11-27 18:18:27
问题 I have a folder called "Datas". This folder has a subfolder called "Inbox" inside of which there are multiple ".txt" files. This "Datas" folder can be modified and in the end there will be multiple subfolders with "Inbox" subfolders and ".txt" files. I need to monitor the "Datas" folder and the ".txt" file from the "Inbox" folder. How can I do that? INotify is just monitoring a folder and pops events when subfolders are created. How to pop events when ".txt" files are created (in which folder

How can I monitor the thread count of a process on linux?

戏子无情 提交于 2019-11-27 16:44:14
I would like to monitor the number of threads used by a specific process on Linux. Is there an easy way to get this information without impacting the performance of the process? try ps huH p <PID_OF_U_PROCESS> | wc -l or htop Each thread in a process creates a directory under /proc/<pid>/task . Count the number of directories, and you have the number of threads. To get the number of threads for a given pid: $ ps -o nlwp <pid> Where nlwp stands for Number of Light Weight Processes (threads) . Thus ps aliases nlwp to thcount , which means that $ ps -o thcount <pid> does also work. If you want to

When to use lock vs MemoryBarrier in .NET

微笑、不失礼 提交于 2019-11-27 14:08:40
问题 In .NET the lock keyword is syntactic sugar around Monitor.Enter and Monitor.Exit , so you could say that this code lock(locker) { // Do something } is the same as Monitor.Enter(locker); try { // Do Something } finally { Monitor.Exit(locker); } However the .NET framework also includes the MemoryBarrier class which works in a similar way Thread.MemoryBarrier(); //Do something Thread.MemoryBarrier(); I am confused as when I would want to use Thread.MemoryBarrier over the lock / Monitor version?

How heavy are Java Monitors?

笑着哭i 提交于 2019-11-27 13:52:07
问题 Say I have an array of thousands of objects, and a small number of threads that might access each of the objects. I want to protect the access to one of the objects methods. Easiest way would be to declare that method as synchronized . However, that might result in creating thousands of monitors, whichever way they are implemented. If this were Win32, I'd never create thousands of kernel objects such as Mutex, but CRITICAL_SECTIONs might be plausible. I'm wondering what's the case in Java.

Registering change notification with Active Directory using C#

孤街浪徒 提交于 2019-11-27 13:44:16
This link http://msdn.microsoft.com/en-us/library/aa772153(VS.85).aspx says: You can register up to five notification requests on a single LDAP connection. You must have a dedicated thread that waits for the notifications and processes them quickly. When you call the ldap_search_ext function to register a notification request, the function returns a message identifier that identifies that request. You then use the ldap_result function to wait for change notifications. When a change occurs, the server sends you an LDAP message that contains the message identifier for the notification request

c# How to get the events when the screen/display goes to power OFF or ON?

我的未来我决定 提交于 2019-11-27 11:59:51
问题 Hi I have been searching but I can't find the answer. How do I know when the screen is going off or on. Not the SystemEvents.PowerModeChanged . I dont know how to retrieve the display/screen EVENTS private const int WM_POWERBROADCAST = 0x0218; private const int WM_SYSCOMMAND = 0x0112; private const int SC_SCREENSAVE = 0xF140; private const int SC_CLOSE = 0xF060; // dont know private const int SC_MONITORPOWER = 0xF170; private const int SC_MAXIMIZE = 0xF030; // dont know private const int

Is it ok to read a shared boolean flag without locking it when another thread may set it (at most once)?

ⅰ亾dé卋堺 提交于 2019-11-27 11:46:41
I would like my thread to shut down more gracefully so I am trying to implement a simple signalling mechanism. I don't think I want a fully event-driven thread so I have a worker with a method to graceully stop it using a critical section Monitor (equivalent to a C# lock I believe): DrawingThread.h class DrawingThread { bool stopRequested; Runtime::Monitor CSMonitor; CPInfo *pPInfo; //More.. } DrawingThread.cpp void DrawingThread::Run() { if (!stopRequested) //Time consuming call#1 if (!stopRequested) { CSMonitor.Enter(); pPInfo = new CPInfo(/**/); //Not time consuming but pPInfo must either

How to monitor asynchronous/background thread status and get notifications in a JSF component

余生颓废 提交于 2019-11-27 09:22:31
I created few threads in a web application and I have a datatable component in JSF page. I would like to update the table automatically to show the current status of thread. Is there any prebuild component I can use in this scenario? BalusC I created few threads in a web application I wholeheartedly hope that you did it the right way and thus it don't end up in an epic disaster. I would like to update the table automatically to show the current status of thread. Is there any prebuild component I can use in this scenario? You're basically looking for a technique called "polling" or "pushing".

What's the meaning of an object's monitor in Java? Why use this word?

社会主义新天地 提交于 2019-11-27 09:09:37
问题 When reading articles about Java threads, I often notice the expression: "current thread is the owner of this object's monitor". I get the meaning: the thread gets the right to operate on the object. But I am puzzled why we use the phrase "the object's monitor" instead of "the object's lock"? In brief, I don't know the meaning of the word 'monitor' The question may be strange and simple. But I wish anybody can help to solve it. 3ks 回答1: but I am puzzled why use word "the object's monitor"