Re: [Dclib-devel] Hello,can you add some feature in dlib
Brought to you by:
davisking
|
From: Davis K. <dav...@us...> - 2009-05-19 11:05:49
|
Why do you want to change the number of threads in the thread pool? Typically I would think you would set it to the number of cores available on your system (which is certainly a fixed number). There is also a main "thread pool" in dlib that manages all threads the library creates via dlib::create_new_thread() and this thread pool is variable sized. It maintains a pool of recent threads so that when you need one they come right back out again. So if you just want to make starting up theads fast then you don't really need to worry about using a thread pool at all since it is automatic. But maybe that isn't what you are trying to do? :) You can set the log level to whatever you want. But it logs levels at and above the level you specify. I'm not sure you would really want to be able to say "log LDEBUG but don't tell me about warnings (LWARN) or errors (LERROR)" since they are probably very important. What are you doing where you want to log just one specific level? Maybe there is a better way. I'm not sure how I would implement logging just a specific thread id. This is because thread ids are basically assigned randomly each time a program runs. In some cases threads end up with the same ids they had in previous runs, but in general, the thread id number that comes out of a logger will get assigned to a different thread the next time you run the program. If you have high level persistent threads in your application it might be better to just give them their own logger objects with different names. I'll have to think about it. There might be some better way to select which threads to log. Cheers, Davis On Mon, May 18, 2009 at 11:46 PM, 水波 <ti...@gm...> wrote: > 1.thead_pool cann't resize; If I want to do this,I have to wait it finished > and then create a new one; > 2.I like to add log to one file.But sometimes I want to record log > with specific log_level or specific thread id > > Thanks for you great job; > > |