harshsxn / jain-slee

Automatically exported from code.google.com/p/jain-slee
0 stars 0 forks source link

Meaningful SLEE thread names #74

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The lack of clear SLEE thread names is inconvenient when troubleshooting 
(analyzing thread dumps), performance tuning (monitoring activity of distinct 
threads in relation to load patterns), etc. Especially so as under JBoss having 
around a hundred threads
(single and pooled) is normal.

I would suggest setting meaningful thread names instead of defaults so
that threads belonging to ER, Timer Facility, etc. could be easily
distinguished.

Suggestion discussed in 
https://groups.google.com/group/mobicents-public/browse_thread/thread/7331f11b01
ee305a.

Original issue reported on code.google.com by vil...@users.sourceforge.net on 30 May 2013 at 2:41

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Although I haven't seen the code regarding Threading, I think the correct 
approach is to use Thread Groups and Thread Factory and an Executor, This is 
how I approach Threading, usually.

    final ThreadGroup tg = new ThreadGroup("Mofokom RA ThreadGroup") {

            @Override
            public void uncaughtException(Thread t, Throwable e) {
                    // do something meaningful?
            }
    };

    final ThreadFactory tf = new ThreadFactory() {

        public Thread newThread(Runnable r) {
            Thread t = new Thread(tg, r);
            t.setPriority(Thread.MAX_PRIORITY);
        return t;
        }
    };

    BlockingQueue<Runnable> workQueue = new ArrayBlockingQueue<Runnable>(
                    (Integer) properties.getProperty("WORK_QUEUE").getValue());

    executor = new ThreadPoolExecutor(
                    EXECUTOR_CORE_POOL_SIZE,
                    EXECUTOR_MAX_POOL_SIZE,
                    EXECUTOR_POOL_TIMEOUT,
                    TimeUnit.SECONDS, workQueue, tf);

Original comment by wozza.xing on 30 May 2013 at 10:24

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 5391b03465d8.

Original comment by EMMart...@gmail.com on 25 Jun 2014 at 3:26

GoogleCodeExporter commented 9 years ago

Original comment by EMMart...@gmail.com on 25 Jun 2014 at 3:34