w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Can Azure Worker Process stop itself?
So I think you're referring to Worker Roles, right? A worker process would simply be something you run in your app (like a thread, a method, something). Azure Worker Roles are full VMs. Assuming that's what you meant: The new announcement about stopping VMs does not apply to Web / Worker Role instances; it applies to Virtual Machines. And those can be stopped easily via REST call (or much easier via PowerShell that wraps the REST call). You could make that call from a Virtual Machine, which would effectively shut itself down, but I'm not so sure that's a sound idea. If you take that approach, it will be very hard for you to track the role-stop progress, since you would have just stopped the VM that made the call.

Categories : Azure

How many instances of a web application are running in one worker process?
I'm not sure if this applies to you, but HttpModule Initialize methods are called more than once because even though there is only one Application instance. One HttpApplication can spawn multiple HttpModule instances, so make sure those initializations are thread safe. Application_Start and _End will fire only once per site start and stop with your current settings, so that will not be the issue. If you are using the HttpContext.Cache object, you might have the issue mentioned in this answer: HashTable in HttpContext.Current.Cache If you want, you can try using WinDbg and get a dump of what is going on in your process but that is a really heavy-handed tactic that probably won't shed as much light as just looking through the code. Not until you look at it a little harder, and are still s

Categories : Asp Net

What is the relationship between Application Pools and worker process threads?
Yes, each application pool is typically a single process1, but can contain multiple threads. You can assign multiple sites to an application pool, and those sites will all run under the same process, however they will run under different "app domains", which are security contexts that separate the code of one site from another, even if they're running on the same app pool. Two users hitting the site at the same time can run on different threads, meaning they can run concurrently. That means any logging can have values interspersed. You might want to add a session value to your logging so you can sort based on session. App pool restarts (recycling) are normal, 20 restarts in a day does not seem unusual. They can happen multiple times per day, and IIS controls when app pools are restar

Categories : Asp Net

ImportError being generated when trying to run django-celery worker process
I'm pretty sure this line is your problem: File "C:sitescorecrmpeoplemodels.py", line 163, in <module> UserProfile._meta.get_field_by_name('username')[0]._max_length = 75 While you're still busy importing from people.models, this line (in particular get_field_by_name) forces Django to evaluate the model and setup all relationships between that model and it's related models. This, in turn, forces an import of Customer in people.models, while you're still busy importing that exact model. This is what results in an ImportError. For a working solution you'll need to post your models.py. Why does this error only occur with celery? I can't say for sure without some more information, but my best guess is that Celery handles importing everything slightly different (Django probably

Categories : Django

Perl's worker don't process connections, waiting on a futex
According to futex man page: This system call is typically used to implement the contended case of a lock in shared memory, as described in futex(7) So my first question: is your Perl script using "Perl Threads" and are you having contention on a shared memory variable?

Categories : Perl

Worker process not releasing memory and Oracle connection not closing
Once I ran into the same issue and I bumped into this article and this one. I exchanged a few emails with the author (Paul Wilson) and he helped me to understand the problem with large objects which are allocated in memory in a "Large Object Heap" and it never gets compacted. This is what he told me: Larger objects are indeed allocated separately, where large is something around 60-90 KB or larger (I don't remember exactly, and its not officially documented anyhow). So if your byte arrays, and other objects for that matter, are larger than that threshold then they will be allocated separately. When does the large object heap get collected? You may have ran into statements about there being several generations of normal memory allocation (0, 1, and 2 in the current f

Categories : Vb.Net

PHP process takes a long time to finish, how can I farm it off to a worker
PHP cant multi-thread, it can fork - but only when not going through apache! Look at using a Worker system, like PHP-Resque It makes life so much easier :)

Categories : PHP

Debug worker project run as a process from another project in VS
You don't give much info about the interaction between the gui and the worker, but if attaching to the process is too hard (typically beacuse the worker only runs briefly), a more usable scenario is to add a configuration option to the gui to add an extra argument to the worker command line, on which the worker responds with a DebugBreak. For example the worker's main would be var args = ParseArguments(); //check if string 'WaitForDeugger' is on command line if( args.RequestsDebug ) System.Diagnostics.Debugger.Break(); .... And the gui invokes the worker like this: var args = GetArgumentsForWorker(); if( someSpecialDebugOptionEnabled ) args += " WaitForDeugger"; Process.Start( "worker.exe", args );

Categories : C#

NServiceBus Distributor Worker creates a new worker queue
When you start the endpoint, you'll see a warning logged, which explains the reason. 2013-08-26 18:56:48,473 [1] WARN NServiceBus.ConfigureDistributor [(null)] <(nu ll)> - 'MasterNodeConfig.Node' points to a local host name: [localhost]. Worker input address name is [Orders.Handler.810aa1ea-7eb4-47b3-b639-724c4498a999@SELEN E]. It is randomly and uniquely generated to allow multiple workers working from the same machine as the Distributor. Here's some documentation on the distributors and the explanation of the Scale out sample as well. http://particular.net/articles/load-balancing-with-the-distributor http://particular.net/articles/scale-out-sample. Check out the Hands on Lab (Intermediate lab), which will walk you through the Scale out lab as well. The Scale out lab will sh

Categories : Misc

I do not understand why this worker cannot spawn a sub-worker in IE10 HTML5
I'm in about the same boat. My plan is to load a subworker from another doamin or file:// protocol because you cannot load one directly from a regular js script. I still need to test this, but I know that Workers/SharedWorkers are not subject to the normal Cross-Origin Restriction Policy, except** for when you're trying to load one (and hopefully only when doing this from a window script). Another method is to use window.postMessage to forward messages to a Worker that it has created in the other window. Alternatively, for my specific needs I am considering running a headless browser locally, a CDN, or a localhost "forever-server" with CORS enabled -- but this most likely still requires a window.postMessage(). Hope this helps, Tim! Post back if you find an answer, eh?

Categories : Javascript

Can I get the ID of my sidekiq worker inside the worker?
You can access the job id using the jid accessor method and the thread id using the Thread.current method. Like this: logger.info "JID #{jid} - TID #{Thread.current.object_id.to_s(36)}"

Categories : Ruby On Rails

Connecting an Azure worker role to a dedicated cache worker role
Hello maybe you should try to set the connection between them using Inter Role Communication, you can find an answer for how to make the inter role communication in the following stackoverflow website: How to do inter-role communication with Azure? you can also find more details in the following link: http://blogs.msdn.com/b/avkashchauhan/archive/2011/10/30/communication-between-windows-azure-roles.aspx I hope this helps you solve your problem please let me know if you need anything else.

Categories : Caching

MFC: sending a msg from worker thread to the Main thread to stop the worker thread
Actually, the only safe way to do anything to a worker thread is from within the worker thread itself. It should probably be structured as a while(bRun) loop so it runs until the program is shutting down. Whatever you are trying to do (stop and start) should be handled by code in the while loop.

Categories : C++

Instantiating a worker role from a worker role
If your worker roles are different applications, you could make use of Service Management API to create a new deployment for WR-2 from WR-1. What you would do is put the package and configuration files of WR-2 in blob storage and when WR-1 has done putting all the messages in the queue, you create a new deployment of WR-2. To create a deployment programmatically using Service Management API, please see here: http://msdn.microsoft.com/en-us/library/windowsazure/ee460813.aspx. However you would need to ensure that once WR-2 has done all the data, it is destroyed by WR-1 so that you don't keep on incurring charges. Other possibility is to run your worker role instances to run in Master/Slave configuration. Let's say there are 2 instances of your worker role running. One of the instance would

Categories : C#

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#

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 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

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++

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

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

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

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 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

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

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#

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

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

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

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#

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

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

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

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#

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



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