spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
  Home » MULTITHREADING » Page 1
Multithread program help in java
What you can do is create a class that implements Runnable. This class will have a constructor That accepts the group Id (like 1,2....) and the list of files which have that group ID. Then you just create new instances of the class and Start the thread For listing the files, you can use any of the methods in File class. (I'm not sure about the method name) Then once you get the list of files, you

Categories : Multithreading

Transaction Per Second not increasing with more threads or servers using WCF
You probably can't give us enough information to diagnose the problem accurately. However, what you describe gives me enough to recommend some places to look. First, you probably shouldn't be spawning 25 (or more) threads in your Windows service. Rather, you can have a single thread looking at the "bucket of transactions," and make asynchronous calls to the WCF service. You can control the number

Categories : Multithreading

Delphi OTL Multitreading UI freezes
The Application UI freezes because it is waiting for all threads have been completed. I had to destroy the ForEach interface at task Completion. Used the OnStop method in the MainForm to destroy the last Thread. Look at: Incrementing Progress Bar from a ForEach Loop {Private declarations} FWorker : IOmniParallelLoop<integer>; FWorker := Parallel.ForEach(0, CalcList.Count-1) .TaskConfig(Pa

Categories : Multithreading

Sub classing TTask in XE7: E2251 Ambiguous overloaded call to 'Create'
Why do you feel you should create a TTask descendant? You should not create a TTask descendant except in very rare circumstances. The better solution is to use a regular task within another object. The Create methods on TTask aren't actually constructors, rather they're static class functions. The reason for this is to ensure that you only ever work with an ITask and not the TTask directly. You a

Categories : Multithreading

Is FormatDateTime thread safe when using the same copy of TFormatSettings across multiple threads?
Yes this is perfectly safe. As long as MySetting is not changed this is the way to use FormatDateTime and other similar procedures. From documentation, System.SysUtils.TFormatSettings: A variable of type TFormatSettings defines a thread-safe context that formatting functions can use in place of the default global context, which is not thread-safe. N.B. You must provide this thread-safe c

Categories : Multithreading

Synchronizing access to FFI calls in Rust (via a global RWLock?)
This problem can be solved using sync::mutex::StaticMutex: extern crate sync; use sync::mutex::{StaticMutex, MUTEX_INIT}; static LIBRARY_LOCK: StaticMutex = MUTEX_INIT; fn access_global_resource() { let _ = LIBRARY_LOCK.lock(); unsafe { call_thread_unsafe_c_api(); } } Many thanks to arrrrrrr1 on #rust, who pointed me in the right direction.

Categories : Multithreading

Store arbitrary data into object instance
Your approach is wrong. What you try to do is basically call the virtual method but without going through the interceptor again. Since the interceptor itself has registered stubs inside the VMT calling the method through invoke will hit the interceptor stub again causing a recursion. I have done this in the past in the Spring4D interception by doing the invoking on a lower level using the Rtti.In

Categories : Multithreading

What was VB6's threading model?
My question is Do VB6 event handlers run in separate threads? Common answer: No. Real answer: Yes, if you make nasty Win32 calls to spawn more threads. The odds of doing this correctly are close to zero. I don't think I've ever seen it in real code. Among other things, the VB6 program had a timer that woke up every 4 seconds, manipulated some global variables and went back to sleep, whil

Categories : Multithreading

Tight Loop - Disk at 100%, Quad Core CPU @25% useage, only 15MBsec disk write speed
It was partially mentioned in the comments, but to enhance on that, as you are working fully single-threaded in the mentioned code (though you use async, you are just waiting for them, so effectively working sync) you are suffering from latency and overhead for context switching and EventStore protocol back and forth. Either really go the async route, but avoid waiting on the async threads and rat

Categories : Multithreading

Access Violation on use OleVariant and TWebBrowser in a Thread
You have two major problems that I can see: You are using COM without initializing it in TNavegar.Execute. In order to access a COM object you do need to initialize COM. You are creating the COM object in one thread but then using it from another thread. I don't think that is going to work out for this COM object. Keep all the access of the web browser COM object to the same thread. And once y

Categories : Multithreading

Are spin locks used only at low level os operations?
Though, the question might look like a duplicate or opinion-based. It contains one particular question: Are spin locks used only at low level os operations? No, spin-locks are generally useful on application level as well. E.g. tbb provides spin_mutex and spin_rw_mutex which in turn are used inside of some concurrent containers (e.g. concurrent_hash_map).

Categories : Multithreading

NodeJs how to compress uint8array in background
You can use built-in zlib module for that. It includes async functions which delegate to thread pool under the hood. The only problem is that it works with Buffers, not typed arrays. There is no good way to convert typed arrays or array buffers into node buffers, so you should consider using buffers for storing binary data.

Categories : Multithreading

Clarifying a Q&A about multithreading
After thread_create we have an extra thread. Clarification: in each process of the last fork since both parent and child calls thread_create, thus 2 extra threads. After the last fork we have the last process duplicated. No, each previously existing processes (3) is split in halves here. At the end we have 6 processes each represented by their respective threads and 2 extra threads cre

Categories : Multithreading

Locking in multiprocessor systems
I'm not exactly sure how to answer this, but here are my ideas: I believe that it would be very unlikely that this would happen at the exact same time. There may be some priority assigned to each thread. The thread with the highest priority will get the lock. This priority could be explicitly kept eg an integer value, or it could be some other metric (such as which thread has had more time exec

Categories : Multithreading

When not to use volatile?
If you don't declare a variable as volatile, and don't do any sort of mutex locking before it is accessed, then yes you always expose yourself to unpredictable behavior and race conditions/deadlocking.

Categories : Multithreading

Lua execute several tasks at once
Take a look a io.popen(prog [, mode]). From the documentation for io.popen, it "starts prog in an other process". Here is how I would implement this: -- launch the prog you want to measure. I assume it does not quit immediately. -- lua will not block here: it does not wait for prog to exit. io.popen('script-you-want-to-measure') -- launch the second process to measure the first. local measure

Categories : Multithreading

Perl forking and IPC::Open2 exec pipes
what's the right way to handle exec pipes across forks in perl, such that I'm not building race conditions into my code? It's very easy to ensure that only one child executes at a time, but then only one child would be executing at a time. That would defy the purpose of your multitasking. You reuse workers in your threaded model, but P::FM uses a new worker for each job. As such, the init

Categories : Multithreading

How to use lightweight thread in Clojure?
You can use future to spawn threads. In this case you could do something like: (doseq [i (take-nth 2 (rest noms))] (future (print (str i " says hello from a lightweight thread! "))))

Categories : Multithreading


Recently Add
Mule Threading Profile's poolExhaustedAction - RUN
Multithread program help in java
Transaction Per Second not increasing with more threads or servers using WCF
Delphi OTL Multitreading UI freezes
Sub classing TTask in XE7: E2251 Ambiguous overloaded call to 'Create'
Is FormatDateTime thread safe when using the same copy of TFormatSettings across multiple threads?
Synchronizing access to FFI calls in Rust (via a global RWLock?)
Store arbitrary data into object instance
What was VB6's threading model?
Tight Loop - Disk at 100%, Quad Core CPU @25% useage, only 15MBsec disk write speed
Access Violation on use OleVariant and TWebBrowser in a Thread
Are spin locks used only at low level os operations?
NodeJs how to compress uint8array in background
Clarifying a Q&A about multithreading
Locking in multiprocessor systems
When not to use volatile?
Lua execute several tasks at once
Perl forking and IPC::Open2 exec pipes
How to use lightweight thread in Clojure?
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.