Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How does Linux pthreads identify the thread control structure?

0
Posted

How does Linux pthreads identify the thread control structure?

0

R Sharada wrote: > I have a query related to how Liux pthreads implementation > idnetifies the thread control structure or descr for a current thread, > in the case when the stack is non-standard ( by way of having called a > setstackaddr /setstacksize ). First off, don’t ever use pthread_attr_setstackaddr(), because it’s a completely brain-damaged interface that’s inherently broken and totally nonportable. I’ve explained why it’s broken (both in terms of engineering features and political history), and I won’t repeat it here. (You can always search the archives.) Just don’t use it. The next version of POSIX and UNIX (2001) contains my corrected version, which ended up being named pthread_attr_setstack(). At some point, this will begin to appear on Linux and other systems. > Currently the method ( in thread_self > routine ) just parses through the whole list of threads until one > matches the current sp and then obtains the descr from there. This could > get quite slow in conditions wh

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123