5.26.2009

Multithreading blobd's networking

I partly multithreaded blobd's netcode tonight, which will give proper behavior for multiple clients. It sort of seems to run ok on my computer, in that it seems to kind of print interesting things on stdout when I wave my hand in front of the camera, but I have no idea what appropriate output should be. This is what it looks like when I wave my hand in front:
0x7fff5cdb9fb0BlobList size is: 33
0x7fff5cdb9fb0BlobList size is: 2
0x7fff5cdb9fb0BlobList size is: 1
0x7fff5cdb9fb0BlobList size is: 10
0x7fff5cdb9fb0BlobList size is: 0
BlobList size is: 1
0x7fff5cdb9fb0BlobList size is: 0
BlobList size is: 27
0x7fff5cdb9fb0BlobList size is: 0
BlobList size is: 3
0x7fff5cdb9fb0BlobList size is: 20
0x7fff5cdb9fb0BlobList size is: 2
0x7fff5cdb9fb0BlobList size is: 14
0x7fff5cdb9fb0BlobList size is: 0


I doubt that memory address should be there -- but does it just list blob counts now, not coordinates? If so, then perhaps mine is behaving correctly. I haven't committed it because I don't want to mess people up, and also because it is a huge hack.

Two big problems are that when a client goes away, there is no thread managing the camera video anymore -- it just hangs waiting for clients. The other big problem is that if two people connect, they are both grabbing frames which is probably not what we want.

I need to rework it I suppose so there is one thread handling the video (and Kevin will expand that lately), and N threads feeding the data out on the network.

I think I would like to rework the network API also. So if/when I get into this, it'll be a good segue into that task as well.

No comments:

Post a Comment