Permalink
Browse files

Merge deprecate_tqueue branch into trunk. This removes the Tqueue PMC…

… from Parrot.

git-svn-id: https://svn.parrot.org/parrot/trunk@37029 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
jkeenan committed Feb 27, 2009
1 parent 52113c9 commit 85bf6e46b76768da7b941dac7120489d668cb734
Showing with 74 additions and 809 deletions.
  1. +2 −4 MANIFEST
  2. +5 −3 PBC_COMPAT
  3. +6 −5 docs/book/ch05_pasm.pod
  4. +1 −1 editor/pir-mode.el
  5. +0 −170 examples/pir/thr-primes.pir
  6. +4 −6 src/pmc/pmc.num
  7. +0 −283 src/pmc/tqueue.pmc
  8. +54 −0 t/codingstd/pbc_compat.t
  9. +1 −67 t/op/gc.t
  10. +1 −208 t/pmc/threads.t
  11. +0 −61 t/pmc/tqueue.t
  12. +0 −1 t/steps/auto_pmc-01.t
View
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Wed Feb 25 17:00:32 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Fri Feb 27 02:52:49 2009 UT
#
# See tools/dev/install_files.pl for documentation on the
# format of this file.
@@ -717,7 +717,6 @@ examples/pir/quine_ord.pir [examples]
examples/pir/readline.pir [examples]
examples/pir/substr.pir [examples]
examples/pir/sudoku.pir [examples]
-examples/pir/thr-primes.pir [examples]
examples/pir/uniq.pir [examples]
examples/sdl/anim_image.pir [examples]
examples/sdl/anim_image_dblbuf.pir [examples]
@@ -2242,7 +2241,6 @@ src/pmc/stringhandle.pmc [devel]src
src/pmc/sub.pmc [devel]src
src/pmc/task.pmc [devel]src
src/pmc/timer.pmc [devel]src
-src/pmc/tqueue.pmc [devel]src
src/pmc/undef.pmc [devel]src
src/pmc/unmanagedstruct.pmc [devel]src
src/pmc_freeze.c []
@@ -2307,6 +2305,7 @@ t/codingstd/fixme.t [test]
t/codingstd/gmt_utc.t [test]
t/codingstd/linelength.t [test]
t/codingstd/make_code_coda.t [test]
+t/codingstd/pbc_compat.t [test]
t/codingstd/pccmethod_deps.t [test]
t/codingstd/pdd_format.t [test]
t/codingstd/perlcritic.t [test]
@@ -2690,7 +2689,6 @@ t/pmc/sys.t [test]
t/pmc/task.t [test]
t/pmc/threads.t [test]
t/pmc/timer.t [test]
-t/pmc/tqueue.t [test]
t/pmc/undef.t [test]
t/pmc/unmanagedstruct.t [test]
t/postconfigure/01-options.t [test]
View
@@ -27,7 +27,8 @@
# please insert tab separated entries at the top of the list
-3.36 2000.02.20 coke removed closure PMC
+3.37 2009.02.26 jkeenan removed tqueue PMC
+3.36 2009.02.20 coke removed closure PMC
3.35 2009.02.15 rurban added bignum.pmc
3.34 2009.01.23 coke removed intlist, enumerate, multiarray, pair, delegate, deleg_pmc PMCs
3.33 2009.01.20 chromatic removed n_neg opcode
@@ -60,7 +61,7 @@
3.06 2007.11.28 coke remove classname opcode
3.05 2007.10.29 allison add get_eh, get_all_eh, and count_eh opcodes
3.04 2007.10.28 paultcochrane remove clear_eh opcode
-3.03 2007.10.17 coke released 0.4.17
+3.03 2007.10.17 coke released 0.4.17
3.02 2007.09.20 bernhard remove opcode hash
3.02 2007.09.07 bernhard deprecate opcode substr_r
3.01 2007.08.17 chromatic store HLL names as strings in frozen Sub PMCs
@@ -77,7 +78,8 @@
2.17 2007.01.16 particle released 0.4.8
2.16 2006.12.16 paultcochrane deleted fetchmethod opcode
2.15 2006.11.14 chip released 0.4.7
-2.14 2006.11.07 tewk added comp_flags to parrot_sub_t
+2.14 2006.11.07 tewk added comp_flags to parrot_sub_t
+2.14 2006.11.07 tewk added comp_flags to parrot_sub_t
2.13 2006.09.23 bernhard remove ops from dotgnu.ops
2.12 2006.08.18 leo removed None PMC from parrot core
2.11 2006.08.16 creiss added STM opcodes
View
@@ -2313,11 +2313,12 @@ threads are still under development, so you can expect significant
changes in the near future.
As outlined in the previous chapter, Parrot implements three different
-threading models. The following example uses the third model, which
-takes advantage of shared data. It uses a C<TQueue> (thread-safe
-queue) object to synchronize the two parallel running threads. This
-is only a simple example to illustrate threads, not a typical usage of
-threads (no-one really wants to spawn two threads just to print out a
+threading models. (B<Note>: As of version 1.0, the C<TQueue> PMC will be
+deprecated, rendering the following discussion obsolete.) The following
+example uses the third model, which takes advantage of shared data. It uses a
+C<TQueue> (thread-safe queue) object to synchronize the two parallel running
+threads. This is only a simple example to illustrate threads, not a typical
+usage of threads (no-one really wants to spawn two threads just to print out a
simple string).
find_global P5, "_th1" # locate thread function
View
@@ -156,7 +156,7 @@ newline or semicolon after an end keyword."
"ParrotRunningThread" "ParrotThread" "Pointer" "Random" "Ref"
"ResizableBooleanArray" "ResizableFloatArray" "ResizableIntegerArray"
"ResizablePMCArray" "ResizableStringArray" "RetContinuation"
- "Role" "Scalar" "SharedRef" "Slice" "String" "Sub" "Super" "TQueue"
+ "Role" "Scalar" "SharedRef" "Slice" "String" "Sub" "Super"
"Timer" "UnManagedStruct" "Undef" "VtableCache"))
(defvar pir-ops
View
@@ -1,170 +0,0 @@
-# Copyright (C) 2001-2008, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-examples/pir/thr-primes.pir - Threads
-
-=head1 SYNOPSIS
-
- % ./parrot examples/pir/thr-primes.pir
-
-=head1 DESCRIPTION
-
-A threaded primes example.
-
-From C<perldoc perlthrtut>:
-
- 1 #!/usr/bin/perl -w
- 2 # prime-pthread, courtesy of Tom Christiansen
- 3
- 4 use strict;
- 5
- 6 use threads;
- 7 use Thread::Queue;
- 8
- 9 my $stream = new Thread::Queue;
- 10 my $kid = new threads(\&check_num, $stream, 2);
- 11
- 12 for my $i ( 3 .. 1000 ) {
- 13 $stream->enqueue($i);
- 14 }
- 15
- 16 $stream->enqueue(undef);
- 17 $kid->join;
- 18
- 19 sub check_num {
- 20 my ($upstream, $cur_prime) = @_;
- 21 my $kid;
- 22 my $downstream = new Thread::Queue;
- 23 while (my $num = $upstream->dequeue) {
- 24 next unless $num % $cur_prime;
- 25 if ($kid) {
- 26 $downstream->enqueue($num);
- 27 } else {
- 28 print "Found prime $num\n";
- 29 $kid = new threads(\&check_num, $downstream, $num);
- 30 }
- 31 }
- 32 $downstream->enqueue(undef) if $kid;
- 33 $kid->join if $kid;
- 34 }
-
-=cut
-
-# translate to PIR by leo
-
-# Runs here (i386/linux 256MB mem) w.
-# ARENA_GC_FLAGS = 1 MAX=500 (~ 95 threads)
-# ARENA_GC_FLAGS = 0 MAX=1000 (~ 168 threads)
-
-
-.sub _main
- .param pmc argv
- .const int MAX = 500
- .local int max
- .local pmc kid
- .local pmc Check_num
- .local pmc stream
- .local int argc
- argc = argv
- max = MAX
- if argc < 2 goto no_arg
- $S0 = argv[1]
- max = $S0
-no_arg:
-
- #sweepoff
-# 9 my $stream = new Thread::Queue;
- stream = new 'TQueue'
-# 10 my $kid = new threads(\&check_num, $stream, 2);
- Check_num = get_global "_check_num"
- kid = new 'ParrotThread'
- $P2 = new 'Integer'
- $P2 = 2
- kid.'run_clone'(Check_num, Check_num, stream, $P2)
-
-# 12 for my $i ( 3 .. 1000 ) {
- .local int i
- i = 3
-lp:
-# 13 $stream->enqueue($i);
- $P3 = new 'Integer'
- $P3 = i
- push stream, $P3
- inc i
- if i <= max goto lp
-# 14 }
-
-# 16 $stream->enqueue(undef);
- $P4 = new 'Undef'
- push stream, $P4
-
-# 17 $kid->join;
- kid.'join'()
-.end
-
-# 19 sub check_num {
-# 20 my ($upstream, $cur_prime) = @_;
-# XXX still no comments inside pcc param block
-.sub _check_num
- .param pmc sub
- .param pmc upstream
- .param pmc cur_prime
-
-# 21 my $kid;
- .local pmc kid
- kid = new 'Undef'
-# 22 my $downstream = new Thread::Queue;
- .local pmc downstream
- downstream = new 'TQueue'
-# 23 while (my $num = $upstream->dequeue) {
- .local pmc Num # num is a reserved word
-lp:
- shift Num, upstream
- $I0 = defined Num
- unless $I0 goto ewhile
-# 24 next unless $num % $cur_prime;
- $P0 = new 'Integer'
- $P0 = Num % cur_prime
- unless $P0 goto lp
-# 25 if ($kid) {
- $I1 = defined kid
- unless $I1 goto no_kid1
-# 26 $downstream->enqueue($num);
- push downstream, Num
- goto lp
-# 27 } else {
-no_kid1:
-# 28 print "Found prime $num\n";
- print "Found prime "
- print Num
- print "\n"
-
-# 29 $kid = new threads(\&check_num, $downstream, $num);
- kid = new 'ParrotThread'
- kid.'run_clone'(sub, sub, downstream, Num)
- goto lp
-# 31 }
-ewhile:
-
-# 32 $downstream->enqueue(undef) if $kid;
- $I1 = defined kid
- unless $I1 goto no_kid2
-
- $P4 = new 'Undef'
- push downstream, $P4
-
-# 33 $kid->join if $kid;
- kid.'join'()
-
-no_kid2:
-# 34 }
- # sleep 1 # turn on for watching memory usage
-.end
-
-# Local Variables:
-# mode: pir
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:
View
@@ -75,10 +75,8 @@ orderedhash.pmc 49
# other
-tqueue.pmc 50
+parrotclass.pmc 50
+parrotobject.pmc 51
-parrotclass.pmc 51
-parrotobject.pmc 52
-
-os.pmc 53
-file.pmc 54
+os.pmc 52
+file.pmc 53
Oops, something went wrong.

0 comments on commit 85bf6e4

Please sign in to comment.