An ithreads teaser

March 14, 2006

An ithreads teaser:

darkshines@darkshines-one ~/svn/px $ ruby build.rb
Bootstrapping pxbuild ...
Checking for sh compatible shell ... yes
Checking for gcc compatible C compiler ... yes
Checking for GNU ld compatible linker ... yes
Checking for ar compatible library packer ... yes
Checking for ranlib compatible library tool ... yes
notice: Checking threading capabilities of this platform ...
Checking for library `pthread' ... yes
Checking for library `pth' ... yes
Checking for x86 compatible CPU ... yes
Checking for define `__NR_futex' ... yes
Assuming SMP machine
notice: Using cpu-x86
Checking for function `pthread_rwlock_init' ... yes
Checking for function `pthread_barrier_init' ... yes
Checking for function `pthread_cond_init' ... yes
Checking for function `pthread_spin_init' ... yes
Checking for function `pthread_mutex_init' ... yes
Checking for function `pthread_create' ... yes
Checking for function `pth_rwlock_init' ... yes
Checking for function `pth_mutex_init' ... yes
Checking for function `pth_cond_init' ... yes
Checking for function `pth_spawn' ... yes
Checking for function `pth_barrier_init' ... yes
Building library `ithreads'
CFG include/ithreads-config.h
CC ithreads.c
>> libithreads.a
Building program `init-test'
CC init-test.c
LD init-test


What about the penguin

January 11, 2006

Google earth for MAC released

Linux? Please?


Random thoughts about Rome

October 16, 2005
  • Colloseum sucks
  • Pantheon rules
  • The mcDonalds’ rock (just their rest-rooms though)
  • There aren’t a lot of italians in Rome
  • I hate merchants trying to sell me anything
  • My mother and sister envy me for all those nice shops I didn’t even care about
  • Pompei is nice
  • The etruskan necropool is better
  • There aren’t metalheads in Rome, well.. italian that is
  • Giolliti and tazza d’ore rock
  • 250 gr of tazza d’ore coffee rocks more
  • sant severa al mare sucks
  • metro’s closed at 21.30 suck
  • rain at the first day sucks
  • colloseum sucks
  • colloseum sucks
  • elevators are fun
  • colloseum’s sucks


pr_trunks problem

October 2, 2005

Bug remaining in the current Gc source that I will fix tomorrow:

The pr_trunk NULL problem.

The pr_trunk, used to resolve a pointer into a managed object to the head of that managed object, can cause problems when one entry of it is NULL.

Two structures are used to resolve a pointer to a managed object to the head of that managed object. pr_offsets and pr_trunks. pr_offsets contains the relative offset of all allocated blocks a.k.a ablocks in the managed heap relative to the pr_trunk its in. Each pr_trunk covers 64KiB of memory of the managed heap.

A pointer is resolved by first making it relative to the start of the managed heap (pointer – mheap). Then getting the pr_trunk it’s in ((pointer – mheap) / 65536). The trunk itself points into the pr_offsets array. By getting the pr_trunk next to the current trunk the amount of allocated blocks inside the trunk can be found. When this is known a simple binary search can be used to find the allocated block.

When a pr_trunk doesn’t contain any allocated blocks it becomes NULL. This behaviour screws up the trunk count lookup and the move to the left trunk when this trunk doesn’t contain it behaviour.

So I got to fix this.

First thing tomorrow morning.

When I had some coffee.


Guess this blog will have a purpose

October 2, 2005

I`ll use this blog to dump my recent development un-ordened, un-cut, un-plugged, etc. in contrary to my real blog.

So, what did I do today?

 ————————————————————————
r26 | darkshines | 2005-10-02 01:53:51 +0200 (Sun, 02 Oct 2005) | 3 lines

– Small updates on documentation

————————————————————————
r25 | darkshines | 2005-10-02 01:35:17 +0200 (Sun, 02 Oct 2005) | 6 lines

– Added seperate source files for the compact and scheduler algorithms.
– Added garbage collection parameters
– Added garbage collection trace function
– Corrected some bugs

————————————————————————
r24 | darkshines | 2005-10-01 22:23:04 +0200 (Sat, 01 Oct 2005) | 10 lines

– Seperated trace routines from gc.c into trace.c (garbage collection code got its own subfolder ‘gc’)
   Updated Makefiles for it
   Updated #include’s in other files for it
– Replaces ‘something = gc_heap + gc_heap_usage; ensure_gc_heap_size(sizeof(something)); gc_heap_size += sizeof(something);’
  with gc_heap_push_alloc and gc_heap_pop_alloc, and replaced usages
– Updated test
– Added -g to test makefile to allow debugging of test1.c
– Fixed bug in _do_walk1 concerning handling of out-of-up_list alloc blocks

————————————————————————
r22 | darkshines | 2005-10-01 20:05:17 +0200 (Sat, 01 Oct 2005) | 7 lines

– Added pointee to pointee object resolvement for tri-color trace
– Added create_type function
– Fixed bug in pointer resolve table creation
– Added ‘last’ pointer-resolve trunk, so trunk sizes can be derived
– Created a bit more realistic, though still static, test

Yes, it was a Garbage Collector day.


Please gimme this back

October 2, 2005

What you should get when testing my Garbage Collector is:

[MM] Heap initialized. uheap = 2792B; mheap = 2094360B.
[MM] Heap freed. 2097152B freed.
[MM] Heap initialized. uheap = 2792B; mheap = 2094360B.
[MM] Managed heap decreased to 2 by 2094358, preserving 0 freespace.
[MM] Managed heap increased by 100 to 102.
[MM] Managed heap increased by 100 to 202.
[MM] Managed heap decreased to 42 by 160, preserving 40 freespace.
[MM] Managed heap increased by 2097152 to 2097194.
Generation 0 (8053ae8-8053ae8 0)
Generation 1 (8053ae8-8053ae8 0)
Generation 2 (8053ae8-8053ae8 0)
Generation 3 (8053ae8-8053ae8 0)
Generation 4 (8053ae8-8053ae8 0)
Generation 5 (8053ae8-8053ae8 0)
Generation 6 (8053ae8-8053ae8 0)
Generation 7 (8053ae8-8253b12 2097194)
8053ae8 reserved type-tree leaf size 1028 (2)
8053eec reserved unmanaged pointer list size 1032 (2)
80542f4 allocation white typed typesize 1 size 10
80542fe allocation white untyped sizesize 1 size 22
8054314 allocation white typed typesize 1 size 10
805431e allocation white typed typesize 1 size 102
8054384 allocation white typed typesize 1 size 10
805438e allocation white typed typesize 1 size 10
8054398 allocation white typed typesize 1 size 10
80543a2 freespace index 0 (1) entry 8053048 .ptr 80543a2 .size 2094960

Unmanaged heap usage 2792
Managed heap usage 2097194
Allocations 160
Reserved internal data 2054
type-tree node 0
type-tree leaf 1025
freeblock-tree node 0
freeblock-tree leaf 0
unmanaged pointer list 1029
fixed other 0
fixed external 0
Headers 22
Allocable freespace 2094958
Uncollected freespace 0

Total memory usage 2099986
[MM] Managed heap decreased to 2236 by 2094958, preserving 0 freespace.
[GC] Entered GC. mheap=2236
[GC MM] Increased gc_heap by 2097152 to 2097152.
[GC] Exited GC. mheap=2099388; time=0ms
[MM] Managed heap increased by 100 to 2099488.
[MM] Managed heap decreased to 2236 by 2097252, preserving 0 freespace.
[MM] Managed heap increased by 100 to 2336.
Generation 0 (8053ae8-8053ae8 0)
Generation 1 (8053ae8-8053ae8 0)
Generation 2 (8053ae8-8053ae8 0)
Generation 3 (8053ae8-8053ae8 0)
Generation 4 (8053ae8-8053ae8 0)
Generation 5 (8053ae8-8053ae8 0)
Generation 6 (8053ae8-8053ae8 0)
Generation 7 (8053ae8-8054408 2336)
8053ae8 reserved type-tree leaf size 1028 (2)
8053eec freespace index 1 (1) entry 8053050 .ptr 8053eec .size 1032
80542f4 allocation white typed typesize 1 size 10
80542fe allocation black untyped sizesize 1 size 22
8054314 allocation black typed typesize 1 size 10
805431e allocation white typed typesize 1 size 102
8054384 allocation black typed typesize 1 size 10
805438e allocation white typed typesize 1 size 10
8054398 allocation black typed typesize 1 size 10
80543a2 freespace index 0 (1) entry 8053048 .ptr 80543a2 .size 102

Unmanaged heap usage 2792
Managed heap usage 2336
Allocations 160
Reserved internal data 1025
type-tree node 0
type-tree leaf 1025
freeblock-tree node 0
freeblock-tree leaf 0
unmanaged pointer list 0
fixed other 0
fixed external 0
Headers 21
Allocable freespace 100
Uncollected freespace 1030

Total memory usage 5128
[MM] Heap freed. 5128B freed.

With some variation when running on 64bit instead of 32bit.


Testers, please

October 2, 2005

For any of those running on linux, please test this:

cd ~
mkdir tmp
cd tmp
svn co svn://w-nz.com/px
cd px
make
cd imgc/trunk/tests
make
./test1

Thank you.


The bliss of your own server

September 29, 2005

The server I own (w-nz.com: 213.133.112.101) is down. There unfortunately seems to be something wrong with the virtual-server software which allows me to have root for just 20 euro’s per month.

Although this issue, like others have, will be resolved within at most a day, it is very annoying.

Along with my server my real blog hosted on it is down.

The more you can customize, the easier it is to break, and it will break. A cheap root-access box seems to break a lot, unfortunately. This makes me think about moving my main blog to here (yea.. wordpress.com). I would sacrifice all the nice stuff I could alter which would be very hard for me, but in return I get rock-solid stability.

On the other hand, I could just pay more for my server and get a real dedicated server, or two :-). Which would make it more stable. Anyone got $200 lying around somewhere for the first month?

This also reminds me of the fact that I really need to get myself a proper job that pays well.

Hire me! (very confincing indeed)

Update: My real blog seems to be online again


Welcome to my wordpress.com

September 29, 2005

Hello and welcome to my wordpress.com blog.

WordPress.com offers free wordpress hosting.

The wordpress used at wordpress.com seems to be cutting edge. A rich text editor is available to you, for instance.

Sadly enough it isn’t as customizable as a wordpress blog hosted on your own server.

I can’t use my own themes, or any plugins. Sadly without for instance wp-hashcash spam will flood this blog when its pagerank rises above 0.

The major advantage of a wordpress.com blog is that you don’t need your own hosting packet, with all the cumbersome installing. And the service could be more reliable than your own server.

Anyway, my real blog.