public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jakub at redhat dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/22309] mt allocator doesn't pthread_key_delete it's keys Date: Thu, 14 Jul 2005 13:38:00 -0000 [thread overview] Message-ID: <20050714133720.24152.qmail@sourceware.org> (raw) In-Reply-To: <20050705135434.22309.jakub@redhat.com> ------- Additional Comments From jakub at redhat dot com 2005-07-14 13:37 ------- Another patch here: <http://gcc.gnu.org/ml/gcc-patches/2005-07/msg00993.html> To test whether _M_get_thread_id/_M_initialize/_M_destroy_thread_key works I was using following testcase under debugger: #include <pthread.h> #include <unistd.h> #include <memory> #include <ext/mt_allocator.h> using __gnu_cxx::__pool; using __gnu_cxx::__common_pool_policy; using __gnu_cxx::__per_type_pool_policy; typedef __common_pool_policy<__pool, true> cpolicy_type; typedef __per_type_pool_policy<char, __pool, true> tpolicy_type; typedef __per_type_pool_policy<unsigned char, __pool, true> upolicy_type; typedef __gnu_cxx::__mt_alloc<char, cpolicy_type> callocator_type; typedef __gnu_cxx::__mt_alloc<char, tpolicy_type> tallocator_type; typedef __gnu_cxx::__mt_alloc<char, upolicy_type> uallocator_type; typedef __gnu_cxx::__pool_base::_Tune tune_type; callocator_type ca; tallocator_type ta; uallocator_type ua; void *tf(void *arg) { callocator_type::pointer p1 = ca.allocate(128); callocator_type::pointer p2 = ca.allocate(5128); ca.deallocate(p1, 128); ca.deallocate(p2, 5128); int idx = (int) (long) arg; if (idx & 1) sleep (1); else sleep (1024); return NULL; } void *tf2(void *arg) { tallocator_type::pointer p1 = ta.allocate(128); tallocator_type::pointer p2 = ta.allocate(5128); ta.deallocate(p1, 128); ta.deallocate(p2, 5128); int idx = (int) (long) arg; if (idx & 1) sleep (1); else sleep (1024); return NULL; } void *tf3(void *arg) { uallocator_type::pointer p1 = ua.allocate(128); uallocator_type::pointer p2 = ua.allocate(5128); ua.deallocate(p1, 128); ua.deallocate(p2, 5128); int idx = (int) (long) arg; if (idx & 1) sleep (1); else sleep (1024); return NULL; } int main() { tune_type t_opt(16, 5120, 32, 5120, 20, 10, false); ca._M_set_options(t_opt); pthread_t th[48]; for (int i = 0; i < 16; ++i) pthread_create (&th[i], NULL, tf, (void *) (long) i); callocator_type::pointer p1 = ca.allocate(128); callocator_type::pointer p2 = ca.allocate(5128); ca.deallocate(p1, 128); ca.deallocate(p2, 5128); sleep (3); tune_type t_opt2(16, 5120, 32, 5120, 36, 10, false); ta._M_set_options(t_opt2); for (int i = 16; i < 32; ++i) pthread_create (&th[i], NULL, tf2, (void *) (long) i); tallocator_type::pointer p3 = ta.allocate(128); tallocator_type::pointer p4 = ta.allocate(5128); ta.deallocate(p3, 128); ta.deallocate(p4, 5128); sleep (3); tune_type t_opt3(16, 5120, 32, 5120, 52, 10, false); ua._M_set_options(t_opt3); for (int i = 32; i < 48; ++i) pthread_create (&th[i], NULL, tf3, (void *) (long) i); uallocator_type::pointer p5 = ua.allocate(128); uallocator_type::pointer p6 = ua.allocate(5128); ua.deallocate(p5, 128); ua.deallocate(p6, 5128); sleep (3); return 0; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22309
next prev parent reply other threads:[~2005-07-14 13:37 UTC|newest] Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top 2005-07-05 13:54 [Bug libstdc++/22309] New: " jakub at redhat dot com 2005-07-05 16:27 ` [Bug libstdc++/22309] " pcarlini at suse dot de 2005-07-05 16:32 ` pcarlini at suse dot de 2005-07-05 16:48 ` jakub at redhat dot com 2005-07-05 16:55 ` pcarlini at suse dot de 2005-07-14 12:48 ` jakub at redhat dot com 2005-07-14 13:01 ` jakub at redhat dot com 2005-07-14 13:38 ` jakub at redhat dot com [this message] 2005-07-14 17:06 ` pinskia at gcc dot gnu dot org 2005-08-26 18:01 ` bkoz at gcc dot gnu dot org 2005-09-01 21:02 ` bkoz at gcc dot gnu dot org 2005-09-09 8:26 ` jakub at gcc dot gnu dot org 2005-09-09 9:19 ` bkoz at gcc dot gnu dot org 2005-09-09 18:21 ` bkoz at gcc dot gnu dot org 2005-09-12 4:49 ` cvs-commit at gcc dot gnu dot org 2005-09-12 19:03 ` bkoz at gcc dot gnu dot org 2005-09-13 19:40 ` bkoz at gcc dot gnu dot org 2005-09-20 5:25 ` [Bug libstdc++/22309] mt allocator doesn't pthread_key_delete its keys cvs-commit at gcc dot gnu dot org 2005-09-24 14:45 ` Woebbeking at web dot de 2005-09-26 23:03 ` bkoz at gcc dot gnu dot org 2005-09-27 14:38 ` Woebbeking at web dot de 2005-09-27 14:43 ` jakub at gcc dot gnu dot org 2005-09-28 17:16 ` Woebbeking at web dot de
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20050714133720.24152.qmail@sourceware.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).