|
|
Home » U++ Library support » U++ Core » Thread::GetCurrentThreadId() and Thread::GetCurrentThreadHandle() new methods
Re: Thread::GetCurrentThreadId() and Thread::GetCurrentThreadHandle() new methods [message #30575 is a reply to message #30556] |
Sun, 09 January 2011 22:28 |
|
mirek wrote on Sat, 08 January 2011 14:07 | Ok, added this:
ThreadId does not make sense for me now (IMO: it is Win32 specific and not really related to Thread).
|
Mirek,
I think that you are not right according by:
http://suacommunity.com/dictionary/pthread_self-entry.php
Quote: | In the Windows threading model each created thread has both a HANDLE and a system-wide unique id. As a result the GetCurrentThreadId Windows function returns the same logical information as the POSIX call.
|
The method DWORD WINAPI GetCurrentThread(void) returns the pseudo-handle, that is not same with the result _beginthreadex(...).
In the other had, you are right, because in POSIX you can manage with the result pthread_self.
In the end, I need an unique Thread ID.
mirek wrote on Sat, 08 January 2011 14:07 | Ok, added this:
ThreadId does not make sense for me now (IMO: it is Win32 specific and not really related to Thread).
Note: The faster alternative to all this might be checking the pointer to TLS variable.
|
About Your Note, can you give me an example, please?
Thank you in advance!
Added:
By TLS variable you mean: Thread-local storage variable?
Like this:
thread__ bool sThreadId;
qword GetCurrentThreadIdCustom(){
return (qword (&sThreadId));
}
[Updated on: Sun, 09 January 2011 22:37] Report message to a moderator
|
|
|
|
|
Thread::GetCurrentThreadId() and Thread::GetCurrentThreadHandle() new methods
By: tojocky on Fri, 07 January 2011 16:38
|
|
|
Re: Thread::GetCurrentThreadId() and Thread::GetCurrentThreadHandle() new methods
By: mirek on Sat, 08 January 2011 13:07
|
|
|
Re: Thread::GetCurrentThreadId() and Thread::GetCurrentThreadHandle() new methods
By: tojocky on Sun, 09 January 2011 22:28
|
|
|
Re: Thread::GetCurrentThreadId() and Thread::GetCurrentThreadHandle() new methods
By: mirek on Sun, 09 January 2011 22:49
|
|
|
Re: Thread::GetCurrentThreadId() and Thread::GetCurrentThreadHandle() new methods
By: tojocky on Mon, 10 January 2011 15:35
|
|
|
Re: Thread::GetCurrentThreadId() and Thread::GetCurrentThreadHandle() new methods
|
|
|
Re: Thread::GetCurrentThreadId() and Thread::GetCurrentThreadHandle() new methods
By: mirek on Mon, 10 January 2011 17:48
|
|
|
Re: Thread::GetCurrentThreadId() and Thread::GetCurrentThreadHandle() new methods
By: tojocky on Mon, 10 January 2011 19:13
|
|
|
Re: Thread::GetCurrentThreadId() and Thread::GetCurrentThreadHandle() new methods
By: mirek on Tue, 11 January 2011 14:49
|
|
|
Re: Thread::GetCurrentThreadId() and Thread::GetCurrentThreadHandle() new methods
By: tojocky on Tue, 11 January 2011 16:11
|
|
|
Re: Thread::GetCurrentThreadId() and Thread::GetCurrentThreadHandle() new methods
By: mirek on Wed, 12 January 2011 09:49
|
|
|
Re: Thread::GetCurrentThreadId() and Thread::GetCurrentThreadHandle() new methods
By: tojocky on Wed, 12 January 2011 12:36
|
|
|
Re: Thread::GetCurrentThreadId() and Thread::GetCurrentThreadHandle() new methods
By: mirek on Wed, 12 January 2011 20:40
|
|
|
Re: Thread::GetCurrentThreadId() and Thread::GetCurrentThreadHandle() new methods
By: tojocky on Thu, 13 January 2011 11:47
|
|
|
Re: Thread::GetCurrentThreadId() and Thread::GetCurrentThreadHandle() new methods
By: mirek on Thu, 13 January 2011 20:51
|
|
|
Re: Thread::GetCurrentThreadId() and Thread::GetCurrentThreadHandle() new methods
By: tojocky on Fri, 14 January 2011 08:12
|
Goto Forum:
Current Time: Tue May 21 10:25:23 CEST 2024
Total time taken to generate the page: 0.02298 seconds
|
|
|