summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/include/rtems/posix/pthreadimpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-06-24 15:43:19 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-07-23 08:01:13 +0200
commitd7665823b208daefb6855591d808e1f3075cedcb (patch)
tree2080d79568c92ae40f9a49f3f82095307766cb1f /cpukit/posix/include/rtems/posix/pthreadimpl.h
parentscore: Introduce Thread_queue_Queue (diff)
downloadrtems-d7665823b208daefb6855591d808e1f3075cedcb.tar.bz2
score: Introduce Thread_queue_Heads
Move the storage for the thread queue heads to the threads. Each thread provides a set of thread queue heads allocated from a dedicated memory pool. In case a thread blocks on a queue, then it lends its heads to the queue. In case the thread unblocks, then it takes a free set of threads from the queue. Since a thread can block on at most one queue this works. This mechanism is used in FreeBSD. The motivation for this change is to reduce the memory demands of the synchronization objects. On a 32-bit uni-processor configuration the Thread_queue_Control size is now 8 bytes, compared to 64 bytes in RTEMS 4.10 (other changes reduced the size as well).
Diffstat (limited to 'cpukit/posix/include/rtems/posix/pthreadimpl.h')
-rw-r--r--cpukit/posix/include/rtems/posix/pthreadimpl.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/cpukit/posix/include/rtems/posix/pthreadimpl.h b/cpukit/posix/include/rtems/posix/pthreadimpl.h
index d0dc330643..f95ac9cf94 100644
--- a/cpukit/posix/include/rtems/posix/pthreadimpl.h
+++ b/cpukit/posix/include/rtems/posix/pthreadimpl.h
@@ -44,7 +44,7 @@ extern "C" {
* The following defines the information control block used to manage
* this class of objects.
*/
-POSIX_EXTERN Objects_Information _POSIX_Threads_Information;
+POSIX_EXTERN Thread_Information _POSIX_Threads_Information;
/**
* This variable contains the default POSIX Thread attributes.
@@ -171,7 +171,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate(void)
_Thread_Kill_zombies();
return (Thread_Control *)
- _Objects_Allocate_unprotected( &_POSIX_Threads_Information );
+ _Objects_Allocate_unprotected( &_POSIX_Threads_Information.Objects );
}
/*
@@ -200,7 +200,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (
Thread_Control *the_pthread
)
{
- _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object );
+ _Objects_Free( &_POSIX_Threads_Information.Objects, &the_pthread->Object );
}
/*