Is there a command in OSGi to get information about the thread pool? E.g. minimum number of threads, current number of threads ... etc.
An OSGi framework does not know anything about thread pools. A framework implementation has some threads for asynchronous task like event dispatching but otherwise does not create threads/thread pools for the bundles. Any threads/thread pools created by bundles are unknown to the framework.
Related
Have some questions regarding NodeJs Architecture:
It says although NodeJs is single threaded, internally it uses libuv library's thread pool? Is it right?
All non-blocking requests handled by main thread and all blocking requests handled by libuv thread pool? While some says there is nothing like main thread. Right or misconception?
If yes, then what happen if thread pool size is 4 and blocking requests are
Request no 5 have to be wait until thread is available? Is it right?
if point 3 is the case, then how NodeJs is different from Java if blocking requests count exceeds thread pool size?
1.
In general, both libuv and v8 are allowed to use (and in fact use) threads.
As a rule of thumb, note that a single threaded JavaScript runtime environment doesn't mean that the underlying libraries cannot use threads.
2.
You can refer to the documentation of libuv to know what will be dispatched on threads.
I cite it:
File system operations
DNS functions
User specified code via uv_queue_work()
3.
It is said that you can queue work on the thread pool.
So, yes, if you queue more work that what you can schedule, requests are going to wait their turn to run.
4.
A thread pool is a concept that abstracts away from the language.
At the end of the day, libuv and thus node are well targeted for I/O bound applications where you do a lot of networking and the API clearly states it.
i am trying to understand the karaf thread model.
from what i can understand in OSGI in case the bundle starts threads it is also responsible for closing them.
is this the case in karaf as well?
are there any other solutions for managing threads in karaf?
Taken from the extra comment.
No the OSGi framework will not manage your threads.
If you spawn threads from your bundle, you are supposed to take care of it.
For example in the stop Method of your Activator you can stop the thread pool you used.
Threads in OSGi work like in plain Java. So for example you can use Executors.
We are now using Task Parallel Library by implementing Task.Factory.StartNew(). Is there any way to check how many threads does the application spawn when executing the task ?
Currently we are running the application in dual core processor in the development environment.
TPL doesn't spawn any threads when executing a task unless you use a custom scheduler or you pass the TaskCreationOptions.LongRunning option. Even then, it is up to the TaskScheduler used to decide how to treat long-running tasks.
TPL schedules individual tasks to a threadpool for execution by the pool's threads. Each Thread has its own queue to reduce conflicts in multi-core machines. If a thread is too busy, the Framework uses some work-stealing magic to assign the task to an idle thread in the same thread pool.
Check How does the tpl use the CLR thread pool for a bit more info, and this post by Daniel Moth for details on work stealing.
I have a project that is actor-based and for one part of it I must use some actors that receive message after that one actor assigns to each request separately and each actor is responsible for doing its message request, so I need something like a thread pool for actors of my project, are there any features in Scala that is useful for my necessity?
I have another question: My project has a great amount of requests and also these requests must be done as soon as possible so I thought that an actor-pool is necessary for handling them, is there any feature in Scala that is related to my demand?
tanks a lot for your attention!
Actors are [already] executed on a thread pool. Initially, there are 4 worker threads. The thread pool grows if all worker threads are blocked but there are still remaining tasks to be processed. Ideally, the size of the thread pool corresponds to the number of processor cores of the machine.
http://www.scala-lang.org/node/242
This is described in detail in this talk. Seventh slide counting from the end describes event driven actors running on a thread pool. This is without any third party library i believe. All built in.
are there any performance limitations using IBM's asynchbeans?
my apps jvm core dumps are showing numerous occurences of orphaned threads. Im currently using native jdk unmanaged threads. Is it worth changing over to managed threads?
In my perspective asynchbeans are a workaround to create threads inside Websphere J2EE server. So far so good, websphere lets you create pool of "worker" threads, controlling this way the maximum number of threads, typical J2EE scalability concern.
I had some problems using asynchbeans inside websphere on "unmanaged" threads (hacked callbacks from JMS Listener via the "outlawed" setMessageListener). I was "asking for it" not using MDBs in the first place, but I have requisites that do not feet MDB way.