w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Forked ptraced process hangs
The short answer is that intercepting syscalls with Go is going to be very difficult, and anything ptrace will probably not work. Go has a runtime which multiplexes go-routines onto OS threads. A syscall is a scheduling point, so after the syscall returns you could be on a different thread, whereas I think ptrace follows a single thread. Say the thread you are ptrace-ing is running your main go-routine. Then you call fmt.Println (which does syscall.Write), so the Go runtime takes your go-routine off that thread, and runs the syscall in a different os thread (syscalls always run in different threads). When the syscall returns, your main go-routine is put back on the schedulers list of runnable routines, and it will continue on whichever os thread is available, which may not be the one yo

Categories : Linux

Long php process hangs the serve. Bad project design?
I think you're loading too much data at once. The whole point of AJAX is to load data a bit at a time, on-demand as you need it. It doesn't really matter that you have a lot of HTTP calls to the server as long as the scripts you're running to return data don't hang like yours is doing. I would suggest questioning whether you really need to return all this data at once. If you think you do, a front-end redesign is probably in order. Don't load so much data at once on a single page that it takes forever to load. If you do, caching and other things will help, but it will never truly fix the problem.

Categories : PHP

Emacs fastest C++ compilation process?
To sum up the answers in the comments. Change the value of compilation-ask-about-save. If you don't want to change this globally (with setq) you can change it just inside your function by wrapping it in a (let ((compilation-ask-about-save nil)) ...function contents...) statement. Bind next-error to something quick: (define-key c++-mode-map "M-j" 'next-error). I personally use global-set-key for this, just because it's useful in a whole bunch of modes. Replace the compile command in your function with (compile "make && ./a.out") (using the name of your executable of course). Hope this helps.

Categories : C++

Using Runtime.exec() to launch Websphere's wsadmin.bat - Hangs while reading from InputStream of the process
In your example code you're reading from the InputStream, but not from the ErrorStream at all, your issue may be that the ErrorStream's buffer is full and this is causing the process to block or deadlock. See the "Why Runtime.exec() hangs" section in this article. The article goes on to describe how to avoid this, but you could simplify the process by using ProcessBuilder instead of Runtime.exec() and then redirecting the ErrorStream. ProcessBuilder pb = new ProcessBuilder("wsadmin", "-host", host, "-port", port, "-username", username, ... ); Process proc = pb.redirectErrorStream(true).start(); //Read from the InputStread as you were... What actually is STDIN in the above case ? proc.getInputStream() will contain any output that running the wsadmin command would produce when you ru

Categories : Java

Don't display *compilation* buffer in Emacs until the process exits with error or warning
The function compilation-start calls display-buffer on the compilation buffer. This should give you all the control you need. I.e., you need to customize one of the action variables (display-buffer-overriding-action et al) so that it will handle compilation buffers specially buy displaying it in a separate frame and not displaying the frame itself. Then you need to customize your compilation-filter-hook so that, whenever a warning or an error is inserted into the compilation buffer, the compilation buffer is displayed visibly (e.g., by popping up the aforementioned separate frame). Don't forget to bind your action variable to nil there!

Categories : Emacs

Using the ion_auth login process and using a templated process to render the login process
There is no need to use ion_auth views or controllers. they are just for reference. we have to use their function as they have define in model for login/logout/register etc... just simply put his model,library and config file to the respective folder of codeigniter in your project and just use their function as they have shown in demo

Categories : Codeigniter

cross memory attach. How do I get the remote address from a child process to a parent process
The system calls process_vm_readv and process_vm_writev are meant for fast data transfer between processes. They are supposed to be used in addition to some traditional way of interprocess communication. For example, you may use a regular pipe or fifo to transfer the required addresses between your processes. Then you may use those addresses to establish faster process_vm_ communication. The simpliest way to transfer something between forked processes should be the pipe() function (man 2 pipe has a good example of its usage). There are many other ways to do so of course, like using sockets or messages. You can even write an address to a file and let the other process read it.

Categories : C

How do I deal with cases when Process.Kill() yields "access denied" because the process is terminating?
Use the command line C# to kill the task, for example Taskkill /F /IM ExeName.exe. If you do not have a persmission to kill the task than also force kill will not help. More info Please check http://www.c-sharpcorner.com/UploadFile/8ea152/kill-process-from-the-command-prompt-in-windows-8/ here an example how to run command line in C# Run Command Prompt Commands Greetings

Categories : C#

multiprocess in python: cross process to process watch-kill-restart
I've enabled Debug functions, and tried to kill and restart child processes from the parent. I've turned A and B in classes and added a shutdown method that kill the failing process, after this, if I try A.start() or A.run() this error appear 'cannot start a process twice'.What this means? the process is dead, there aren't others running. If I call multiprocessing.active_childre() the process aren't restarted but got this output: <Process(SyncManager-2, started)>, <Process(SyncManager-1, started)>, <Process(SyncManager-3, started)>] [INFO/MainProcess] process shutting down [DEBUG/MainProcess] running all "atexit" finalizers with priority >= 0 [SUBDEBUG/MainProcess] calling <Finalize object, callback=_decref, args=(Token(typeid='Value', address='/tmp/pymp-2ObnP1

Categories : Python

Node.js Detached child process is invoked as interactive foreground process
I think this may be a problem with node on windows. I tried both your code and the sample code on the node documentation you are for sure referencing yourself at http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options on my Ubuntu virtual machine and it works just fine. Process is detached and keeps running and there is no output anywhere but to out.log because it is running successfully in the background. I ran both a simple ping command and also ran a node instance on a javascript file like you are trying to do and both worked just fine. I would recommend you do the same with a ping command in windows. . . var child = child_process.spawn('ping', ['-n','25','localhost'],. . . If that works like you would expect, there may be something insi

Categories : Javascript

How to get process (external program) time, cpu usage for process run from java application?
Run this program in a separate thread, then run tasklist /v process (if Windows), intercept output, split lines into columns, find my-simple-app.exe and get necessary info. If tasklist info is not enough, then read process ID column form tasklist output and run some other util to get more info.

Categories : Java

In Java What is the exit value of a process which is killed in the background through Linux shell using process id
This is not a Java specific question. The return code will be the same for all Unix systems here (at least I have never seen a Unix system not behaving this way): 128 + the number of the signal which caused the process to terminate. No idea for Windows... Therefore, 130 in your case. In C, you'd check (after a call to waitpid() for instance) whether a process has been terminated by a signal using WIFSIGNALED(status).

Categories : Java

Symfony2 Process component - unable to create pipe and launch a new process
The file handles are not being garbage collected, so they eventually fill up (os limit or php limit, not sure), but you can fix it by adding an explicit garbage collection call: gc_collect_cycles(); usleep($sleep * 1000000); Also, be forwarned that garbage collection doesn't work very well inside a foreach loop because of the way that php maps the temporary $foo as $bar => $var array variables into memory. If you need it in that part of the code you could switch it to something like this instead, which I think should allow for garbage collection inside the for loop: $processes[] = new Process("ls > /dev/null", null, null, null, 2); $processes[] = new Process("date > /dev/null", null, null, null, 2); $sleep = 0; do { $count = count($processes); for($i = 0; $i < $co

Categories : PHP

How to create a new process with command line arguments and give the PID to the parent process?
You can use createprocess() function in windows. Its signature is below BOOL WINAPI CreateProcess( _In_opt_ LPCTSTR lpApplicationName, _Inout_opt_ LPTSTR lpCommandLine, _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes, _In_ BOOL bInheritHandles, _In_ DWORD dwCreationFlags, _In_opt_ LPVOID lpEnvironment, _In_opt_ LPCTSTR lpCurrentDirectory, _In_ LPSTARTUPINFO lpStartupInfo, _Out_ LPPROCESS_INFORMATION lpProcessInformation ); Example: STARTUPINFO si; PROCESS_INFORMATION pi; //This structure has process id ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); if( argc != 2 ) { printf("Usage: %s [

Categories : C++

The process cannot access the file 'x' because it is being used by another process while deleting saved image by application
This is explained in the documentation for Image.FromFile: The file remains locked until the Image is disposed.

Categories : Vb.Net

FileMode and FileAccess and IOException: The process cannot access the file 'filename' because it is being used by another process
You need to release control of the file from Program A. Try closing or disposing the streamwriter when you finish. Or you might attempt using as is described in the answer to this question: Releasing access to files

Categories : C#

How to trigger an automatic screen lock process on my android phone after a specified process running specified time?
How unlock and lock screen programatically in android Has some excellent information on immediately calling the lock screen. You could implement a system using an alarm manager to trigger this event.

Categories : Android

Is a multi process Java program a single process in the context of the actual machine underneath the JVM it is running on?
You're confused between processes and processors. A JVM counts as a single process on your machine, yes. When you start the JVM it runs as a program and it executes Java byte code. A JVM can address all the processors on you machine. When you start a Thread in Java it executes on an available processor.

Categories : Java

Using Start-Process for starting a process having its full command line
Do you need start-process? Can you invoke the executable directly? & "C:Dir 1Dir 2executable.exe" -arg1 "value 1" -arg2 "value 2" See help about_Operators and for info on & (call) operator. Bill

Categories : Powershell

Getting the list of child process, called by a parent process in Linux
The f option of the ps command will help. Try: ps afx This will show all processes and will visualize parent -> child dependencies in the console.

Categories : Linux

how to run back-end (Non-Stop process) process without affect the Ui Thread in Android
@forgivegod is right (about the service), that will get you in the background. However, if your process is really tightly coupled with an Activity (i.e. you want it to match the lifecycle by starting on Activity start and stopping on Activity stop, instead of running outside of that lifecycle) then I think an AsyncTask would get you what you need.

Categories : Android

Error "The process cannot access....becuse it is being used by another process. " in Delete Image
When you use Image.FromFile, that will open a file handle to that file and keep it open until the image is disposed. You should: Only call Image.FromFile once and reuse the object in Setimage (you're loading it twice in a single if condition...) Dispose of every Image when you're done with it Dispose of the old BackgroundImage before you set the new one So long as you dispose of every Image which is related to the file before you delete the file, you should be okay.

Categories : C#

Is it possible to use "kill" to send a signal to a process without forcing the process to exit?
According to the man pages for kill and signal(7), the best you could hope for would be to stop and then maybe continue. But I don't think that will do what you want. I also question the desire to use "kill", a command whose name makes its intended purpose very clear, to do this. Almost every signal you can send with kill is intended to terminate a process or cause it to dump core. I'm not an expert but I think you are trying to use the wrong tool here.

Categories : Linux

PHP ajax process 404 page not found error before complete the process
You can rise the time that a script is allowed to execute: http://php.net/manual/de/function.set-time-limit.php Give attention to your max_execution_time in php.ini But i wouldnt suggest if you are doing this in the frontend then it sounds more like an performance problem of your script. No user want to wait more than 4 seconds for website. Also 2 seconds are too long.

Categories : PHP

Can we dynamically create a process and maintain a process pool?
If what you need is to monitor the child processes and spawn them when they go down, then this approach may be helpful. Make the parent process to wait for changes in child using waitpid in a loop. Maintain a counter at parent to track number of processes alive. Based on your requirement, you can create one or more new child process using fork call and update the counter. Man of fork is here. Similar question to track the death of child is here.

Categories : C++

signal handling when process is waiting for another process to terminate
The kernel doesn't really care that process-1 is "waiting for process-2 to finish" (in particular it's not interested in "why" it's in the state it is, merely that it is in some state: in this case, idling in the kernel waiting for some event). For typical1 caught signals, the signal-sender essentially just sets some bit(s) in the signal-receiver's process/thread state, and then if appropriate, schedules that process/thread to run so that it can see those bits. If the receiver is idling in the kernel waiting for some event, that's one of the "schedule to run" cases. (Other common situations include: the receiver is in STOP state, where it stays stopped except for SIGCONT signals; or, the receiver is running in user mode, where it is set up to transition to kernel mode so as to notice th

Categories : C++

how to get process id(pid) from forked child process in shell script
From the Bash manual: ! Expands to the process ID of the most recently executed background (asynchronous) command. i.e., use $!.

Categories : Linux

How to close Child Process without affecting on the Parent Process
May be the following link can help you to achieve what you want to do: Code Snippet: Terminate all child processes

Categories : C#

Perl ipc using pipe to intiate the execution of one process from another process
You could use IPC::Open3 to do this: my($wtr, $rdr, $err); use Symbol 'gensym'; $err = gensym; my $pid = open3($wtr, $rdr, $err,'some cmd and args', 'optarg', ...); ### Do something in the main prg waitpid( $pid, 0 );#when you no longer needs the child my $child_exit_status = $? >> 8;

Categories : Perl

Does a process started by C# Process.Start() inherit ErrorMode?
If you watch with resharper/ilspy and/or you watch the sources of .NET you'll see that in Process.StartWithCreateProcess(ProcessStartInfo startInfo) all the magic happens. num2 is the variable that contains the dwCreationFlags. Your flag isn't visible anywhere. Sometimes StartWithCreateProcess sets the 0x8000000 (CREATE_NO_WINDOW) (if the CreateNoWindow parameter is set) and the 0x400 (CREATE_UNICODE_ENVIRONMENT) (if the system is NT based) flags, but that's all.

Categories : C#

System.IO.IOException: The process cannot access the file because it is being used by another process
Short answer: Try Thread.Sleep(100) before you read and then read as fast as you can. I thought that by setting the FileAccess.Read I should be able to always read the file? By setting FileAccess.Read you are just saying that you need to read from the file. By setting FileShare.ReadWrite you are saying you are comfortable with the 3rd party reading and writing to the file while you read it. The exception means that the 3rd party is not comfortable with you reading while they are writing. Your first bet is to check if you can configure the 3rd party process to allow other processes to read while they write, but be aware that reading from a file that is being written to can be troublesome. How can I make sure that this doesn't cause an exception, or do I need to just loop around un

Categories : C#

How to kill a child process started by process in java?
You should use this code instead: Process p= Runtime.getRuntime().exec("iperf -s"); InputStream in = p.getInputStream(); FileOutputStream out = new FileOutputStream("testresult.txt"); byte[] bytes; in.read(bytes); out.write(bytes); This code will not work exactly, but you just need to fiddle with the streams a little.

Categories : Java

The process cannot access the file 'xxx' because it is being used by another process when Exporing to PDF using ReportViewer
It was solved by seting reportviewer = null and adding a finally to the catch public bool Export(string accountNumber, DateTime settlementDateTime, string PDFfileName, out string errorMsg) { bool success; ReportViewer reportViewer; Warning[] warnings; ReportParameter[] rptParameters; string[] streamids; string mimeType; string encoding; string filenameExtension; byte[] bytes; FileStream fs ; success = false; errorMsg = string.Empty; fs = null ; reportViewer = null ; try { Console.Out.WriteLine(String.Format("Generando extracto para la cuenta "{0}" de la fecha {1}", accountNumber, settlementDateTime)); reportViewer = new ReportVie

Categories : C#

The process cannot access the file because it is being used by another process - using static class
In your MakeThumbnail methods, make sure you're calling Dispose() on the Image types. That or use the using syntax: using (Image img = Image.FromFile(ImgIn)) { // Your code }

Categories : C#

IOException The process cannot access the file because it is being used by another process when using XDocument
You can still use XDocument and an XmlReader: XDocument doc; using (var reader = XmlReader.Create("C:/Trio Scripts/example.xml")) { doc = XDocument.Load(reader); } When the using block completes for the reader, then the file handle should be closed. Update: Maybe the behavior of XmlReader.Create(string) doesn't open the file in the most minimal fashion. In case that's what's causing the exception, try this more explicit code specifying file permissions: XDocument doc; using (var stream = File.Open("C:/Trio Scripts/example.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) using (var reader = XmlReader.Create(stream)) { doc = XDocument.Load(reader); }

Categories : C#

How does process blocking apply to a multi-threaded process?
Let's say you have a work queue where the UI thread schedules work to be done and the IO thread looks there for work to do. The work queue itself is data that is read and modified from both threads, therefor you must synchronize access somehow or race conditions result. The naive approach is to synchronize access to the queue using a lock (aka critical section). If the IO thread acquires the lock and then blocks, the UI thread will only remain responsive until it decides it needs to schedule work and tries to acquire the lock. A better approach is to use a lock-free queue about which much has been written and you can easily search for more info. But to answer your question, yes, it is still much easier than you might think to cause UI to stutter / hang even when using multiple th

Categories : Multithreading

Check if a process started with Process.Start is still running?
I found a way to check if one process has the file in his "CommandLine", meaning that it is currently editing the application: private static void OpenProcessIfNeeded(String file) { using (ManagementObjectSearcher mos = new ManagementObjectSearcher("SELECT CommandLine FROM Win32_Process")) { foreach (ManagementObject mo in mos.Get()) { if (mo["CommandLine"] != null && mo["CommandLine"].ToString().IndexOf(file, StringComparison.InvariantCultureIgnoreCase) > -1) { Console.WriteLine("Found!: " + mo["CommandLine"]); return; } } } Process.Start(file); }

Categories : C#

Getting Windows error 32 process can not access file it is used by another process
Something is holding a reference to the file you try to move. Place a try/except block around the shutil.rename and print out which file causes the problem. When you find out which file causes the problem find out who is holding a reference to it. One way to find who is holding a reference to a file is either using Process Explorer or Unlocker Update: I took a look at the code of the ID3 library and it seems that, if you pass in a filename, it doesn't close the file, EVER :D You should do something like: with open(filename, 'rb') as f: tags = ID3(f) # do your stuff shutil.rename(filename, ...)

Categories : Python

Background process that will kill the current process
If you use: os.system('/path/to/script.sh &') or subprocess.call('/path/to/script.sh &', shell=True) The process will keep going even if the python script dies. If you are always going to reboot, let the OS kill the parent and you not worry about it.

Categories : Python

How to get the Parent Process ID by giving a Process ID in Linux using C/C++?
I think you can use get_proc_stats function to do this. But you need to install the libproc-dev library. Here is an example : proc_t p_info; get_proc_stats(pid_num, &p_info); int parent_pid = p_info.ppid;

Categories : C++



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.