Is the code running on this thread short lived? Would it make sense
to use the worker pool?
On Thu, Nov 6, 2008 at 10:57 PM, Wan-Teh Chang <[EMAIL PROTECTED]> wrote:
>
> On Thu, Nov 6, 2008 at 12:33 AM, Ibrar Ahmed <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>> I am currently working on (Issue 4152: Porting directory_lister to
>> POSIX.). While looking at the code a question bumped into my mind that
>> why we are creating thread using
>>
>> unsigned thread_id;
>> thread_ = reinterpret_cast<HANDLE>(
>> _beginthreadex(NULL, 0, DirectoryLister::ThreadFunc, this, 0,
>> &thread_id));
>>
>> AFAIK there are classes to manage threads in code base. Why we have
>> not used these classes
>>
>> I.e
>>
>>
>> thread_.reset(new base::Thread("director_lister"));
>> thread_->Start();
>> message_loop_ = thread_->message_loop();
>>
>> message_loop_->PostTask(FROM_HERE, NewRunnableMethod(
>> this, &DirectoryLister::ThreadFunc));
>>
>>
>> Can we replace code with this piece of code?
>
> Perhaps because the Thread class has a message loop that
> we don't need for directory_lister? It seems that we can use
> the PlatformThread class though.
>
> Wan-Teh
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Chromium-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/chromium-dev?hl=en
-~----------~----~----~----~------~----~------~--~---