I discovered Protothreads through a link in Chris Double's weblog on Saturday. This is a fascinating tiny library, written by Adam Dunkels, a researcher at the Swedish Insitute of Computer Science. The Protothreads library implements user-level in threads in portable ANSI C in a mere 20 lines of code, and each thread uses only 2 bytes of RAM! While having a few important limitations, this comes in handy for a lot of problems, especially when writing single-threaded network servers (using Protothreads, you don't have to use state machines to do protocol handling). While checking out Protothreads, I stumbled across the very interesting link list that Adam Dunkels compiled while writing his library. From there, I got hooked and browsed the rest of Adam's website.
He has written two incredible TCP/IP stacks aimed at embedded systems. The first one, uIP, is targeted at 8bit microcontrollers, and has a very low RAM usage (it runs with as few as 128 bytes RAM for full TCP/IP support). The development version of uIP uses Protothreads to offer a BSD-style socket interface while maintaining its low RAM usage. The second stack, lwIP, is targeted at bigger embedded systems, and offers a BSD-style API.
Adam is a computer scientist working in the field of sensor networks, which are a part of the research field of ubiquitous computing. Sensor networks consist of a myriad of little embedded systems gathering environmental data through a set of sensors. However, the real value of sensor networks stems from the communication between all these systems. As Adam put it, "the nodes are interchangeable: it is the data generated by the sensors that are the primary interest". Besides uIP, which he uses as a mean to communicate between the sensor nodes, Adam works on Contiki, an embedded operating system. Contiki allows the dynamic loading of code on sensor nodes, which proves to be very useful when deploying sensor networks.
I emailed Adam a few questions about his software, embedded programming and sensor networks. He was very kind to provide exhaustive and very interesting answers. Enjoy the interview:)
Protothreads
These first three questions are about Protothreads, the minimal threading library Adam has written for his embedded platforms. Protothreads are inspired by coroutines, which can be sort of implemented in C using a neat little trick.
Question: Adam, what was your motivation to write protothreads? Answer: The driver behind the development of protothreads was many years of writing event-driven code. After a while, one sees the need to have a nicer abstraction than finite state machines. Ordinary threads have many of the good properties of such an abstraction, but they have two problems: the RAM overhead is prohibitive on systems with very small memory resources ---the typical target system for uIP---, and they require a fair amount of platform specific code. As I wanted to keep both uIP and Contiki as portable as possible, this was definitely a problem.
After thinking long and hard about this, as well as reading lot of papers on the subject of concurrency, the protothreads concept dawned on me. Very simple, yet powerful. Very little RAM overhead and possible to implement in pure C. Perhaps the nicest thing is the extremely small size of the implementation. With all comments removed, the entire library can be reduced to 20 lines of code (that goes into a header file, no less!).
Question: What kind of software uses Protothreads currently? Answer: Currently, the Contiki OS and the development version of the uIP TCP/IP stack are using protothreads. Among other things, they are used to implement a network API called "protosockets", which are similar to the BSD socket API but based on protothreads. This means that they can be used without underlying full multithreading, which subsequently means less RAM overhead.
Question: What kind of software do you think will use Protothreads in the future? Answer: I
I had friends who ran e-commerce sites that lost anything from several hundred dollars to several thousand from WorldPay and Paypal outages. The question is, what happens when this becomes more widespread? Especially considering that more and more reliance is starting to be put on e-commerce.
"There are two ways to build $10 billion in network infrastructure. The first is to get ten large firms to pony up a billion, and the second is to get 10 million users to spend a hundred dollars each."
Riight. Surely 10 million times $100 is $1bn as opposed to $10bn?
So.. Am I the only person who thinks finding patterns in the financial markets is useless?
Not because I don't believe they exist but that with their discovery would come a change in the patterns themselves, thus making each 'discovery' relatively useless.
If you knew what the path to losing your livelihood was.. wouldn't you try to do everything possible to _not_ go down that path? Thus opening new paths and forming new patterns which would destroy the old ones.
Hmmm, as nice as Zaurus FreeCiv is, it's not been updated in a year and lacks many key features that actually make the game vaguely playable. It, like many Zaurus apps, are great ideas and projects started with lots of enthusiasm but that eventually ground to a halt in a half finished state.
It's a shame.
Lack of decent up to date software.
on
Zaurus SL-6000 Review
·
· Score: 5, Interesting
I'll probably get some flak for this but what the hell.
I own both a Palm PDA and a Zaurus (Treo 90 and SL-5000), the former is a perfect organiser whereas I hardly consider the latter to be. My Zaurus is let down by many things, firstly the fact that there exists relatively little up to date organiser software for it that even comes anything close to many of the free Palm apps out there.
Secondly, installing some of the more interesting applications on the Zaurus requires you to jump through herculian hoops to get things working.
Lastly, people'll probably point to webpages chocked full of Zaurus applications (http://www.killefiz.de/zaurus/ being one) but one closer inspection you'll find that many of the more useful applications are either in a half finished state or haven't been maintained in several years and lack features needed to work with newer desktop versions.
Don't get me wrong, I love my Zaurus. There's nothing like pulling it out of your pocket, firing up the WiFi, ssh'ing into your box and synching your local MySQL server. Just don't buy it if you're looking for an organiser, you'll be bitterly disappointed.
I'm shocked that this was moderated as funny, it's not. This guy's just being racist. The biggest chunk of spam I receive comes right out of the US and UK.
Some of you guys might want to look at VirginRadio's website (www.VirginRadio.com), they have a broadband stream (you've got to put in a password to access it, free reg though). The twist is, it's a peer to peer stream, they use a plugin by AllCast.
Apparently, what this plugin does is contact the server and obtain a list of listeners, it then find a listener with atleast a 100kbs upload capacity and connects to them, receiving their stream from them. You'd think there'd be lots of problems.. e.g, it'd be slow, you'd get your bandwidth sucked away, you'd get cut off randomly. Well.. no. I've been listenening for about three days now, i've been cut off only twice in that time and i've had somebody else connected to me most of that time as well and I didn't even notice it till I looked at my upload stats later in the day.
I'll put my money on this being the way to get around the problem, why does the server need to be the one to be dishing out all the bandwith? Why doesn't the server just serve the streams to other users, who in turn serve it to other users. Fairs fair.
Apparently the 'wrapping your number plates in shiny plastic' trick doesn't work.
Nearly all the camera's will only catch you if you're doing more than 10/15mph+ over the speed limit, so the best 'trick' to get around it is to keep your speed down. I have been flashed once (if I get two tickets in the next two years, i'll have to retake my tests [driving and theory]) for doing 45mph in a 30mph zone because some fool in the lane next to me wouldn't let me get into the right hand lane, so I could take the right turning at the round-about. Apparently the Camera's can't detect your speed if there are two cars going over the area at exactly the same time, which was probably what happened in my case.
Hiya, I just downloaded and installed Virtual-U and i'm getting an error bitching about not being able to open RESOURCES\A_WAVE2.RES. Anyone else getting something like this?
- Sadiq www.toao.com
You think you're being ripped off? Pah!
on
Broadband Obstacles
·
· Score: 2, Informative
I'm proud to say that us British can claim to be shafted in so far as physically possible when it comes to broadband. Let's see... what do we get for our $60/month ADSL? We get 512k downstream and 256k upstream, a 50:1 contention ratio, a telco that really really doesn't have _any_ clue what's going on and periods where you really wish you were back on a modem, and thats _IF_ you're lucky to live in an area where your exchange has been activated.
(Yes, we do have cable modems but one of the large cable telco's [Cable & Wireless] managed to shaft all of our cable network, which means NTL can't even give us a timeline for when we'll have cable access)
I have a cousin living in Tanzania who get's wireless broadband at a megabit, for less than $30/month. That's got to be taking the piss abit.
I saw a guy earlier who was complaining that a T1 cost $600 a month. Do you have any idea how much a 64k leased line costs over here? You'd be lucky to get a 128k leased line for $600 a month from BT.
Don't complain. Whatever services you've got, be happy with. If you're like me and still sitting on a 56k modem because the cachement area for the local ADSL-enabled exchange stops 3 doors down [and your's isn't enabled], THEN you have something to complain with.
Sorry if i'm just ranting, but you've got to be happy with what you've got, you don't know how much better off you have it, compared to other places.
Hi, To a certain extent this is slightly off-topic... but you American's have NO right to call your petrol prices high. Here in England, we pay more than triple what your paying (even at its peak). If anyone needs alternative types of fuel for cars, it's us British... Roll on cold fusion.. =)
Way of stopping squatting...
on
Pirate DNS?
·
· Score: 1
I thought of some possible ways of preventing squatting. First, up the price of a domain, having domain hovering around the $10/year mark is stupid, people are just going to buy huge amounts at that price. Secondly, ban the resale of domains. Thirdly, a domain can only be registered if it is payed for at the time of registration, none of the way NSI used to give you a grace period to pay for the domain, which enabled squatters to register and re-register large amounts of domains, for nothing. I think implementing those would make quite a difference when it comes to domain squattings/squatters... Its a sad sad day when a webmaster can't even find a decent domain name for his website..
It might just be me, but it said that they monitor all email/fax/telephone conversations in Europe.. but doesn't that require the co-operation of the other European telcos? What about email? wouldn't that require something somewhere along the line sorting out all the email stuff? If so.. where is it? Do our ISPs know about it? (I'm in the UK) or is everything based at the telcos.. (which'd make slight sense.. fax/email/phone all go through them.. one way or another..).. It just seems wierd that something of this power and complexity isn't completely out in the open if it could do what it is supposed to do..
Interview with Adam Dunkels
:)
I discovered Protothreads through a link in Chris Double's weblog on Saturday. This is a fascinating tiny library, written by Adam Dunkels, a researcher at the Swedish Insitute of Computer Science. The Protothreads library implements user-level in threads in portable ANSI C in a mere 20 lines of code, and each thread uses only 2 bytes of RAM! While having a few important limitations, this comes in handy for a lot of problems, especially when writing single-threaded network servers (using Protothreads, you don't have to use state machines to do protocol handling). While checking out Protothreads, I stumbled across the very interesting link list that Adam Dunkels compiled while writing his library. From there, I got hooked and browsed the rest of Adam's website.
He has written two incredible TCP/IP stacks aimed at embedded systems. The first one, uIP, is targeted at 8bit microcontrollers, and has a very low RAM usage (it runs with as few as 128 bytes RAM for full TCP/IP support). The development version of uIP uses Protothreads to offer a BSD-style socket interface while maintaining its low RAM usage. The second stack, lwIP, is targeted at bigger embedded systems, and offers a BSD-style API.
Adam is a computer scientist working in the field of sensor networks, which are a part of the research field of ubiquitous computing. Sensor networks consist of a myriad of little embedded systems gathering environmental data through a set of sensors. However, the real value of sensor networks stems from the communication between all these systems. As Adam put it, "the nodes are interchangeable: it is the data generated by the sensors that are the primary interest". Besides uIP, which he uses as a mean to communicate between the sensor nodes, Adam works on Contiki, an embedded operating system. Contiki allows the dynamic loading of code on sensor nodes, which proves to be very useful when deploying sensor networks.
I emailed Adam a few questions about his software, embedded programming and sensor networks. He was very kind to provide exhaustive and very interesting answers. Enjoy the interview
Protothreads
These first three questions are about Protothreads, the minimal threading library Adam has written for his embedded platforms. Protothreads are inspired by coroutines, which can be sort of implemented in C using a neat little trick.
Question: Adam, what was your motivation to write protothreads?
Answer: The driver behind the development of protothreads was many years of writing event-driven code. After a while, one sees the need to have a nicer abstraction than finite state machines. Ordinary threads have many of the good properties of such an abstraction, but they have two problems: the RAM overhead is prohibitive on systems with very small memory resources ---the typical target system for uIP---, and they require a fair amount of platform specific code. As I wanted to keep both uIP and Contiki as portable as possible, this was definitely a problem.
After thinking long and hard about this, as well as reading lot of papers on the subject of concurrency, the protothreads concept dawned on me. Very simple, yet powerful. Very little RAM overhead and possible to
implement in pure C. Perhaps the nicest thing is the extremely small size of the implementation. With all comments removed, the entire library can be reduced to 20 lines of code (that goes into a header file, no less!).
Question: What kind of software uses Protothreads currently?
Answer: Currently, the Contiki OS and the development version of the uIP TCP/IP stack are using protothreads. Among other things, they are used to implement a network API called "protosockets", which are similar to the BSD socket API but based on protothreads. This means that they can be used without underlying full multithreading, which subsequently means less RAM overhead.
Question: What kind of software do you think will use Protothreads in the future?
Answer: I
Don't they already have enough affiliate spam in adwords?
Must they allow people to automate it?
I sometimes wonder...
Erm,
What's wrong with user-mode linux? Why are people re-inventing the wheel?
I had friends who ran e-commerce sites that lost anything from several hundred dollars to several thousand from WorldPay and Paypal outages. The question is, what happens when this becomes more widespread? Especially considering that more and more reliance is starting to be put on e-commerce.
"There are two ways to build $10 billion in network infrastructure. The first is to get ten large firms to pony up a billion, and the second is to get 10 million users to spend a hundred dollars each."
Riight. Surely 10 million times $100 is $1bn as opposed to $10bn?
So..
Am I the only person who thinks finding patterns in the financial markets is useless?
Not because I don't believe they exist but that with their discovery would come a change in the patterns themselves, thus making each 'discovery' relatively useless.
If you knew what the path to losing your livelihood was.. wouldn't you try to do everything possible to _not_ go down that path? Thus opening new paths and forming new patterns which would destroy the old ones.
Helloooo open proxies.
$300k per employee? I wonder how much of that is in weed.... could explain alot of things...
"The backdoor seems to have been created by the vendor that used to package devices for NetGear"
Handle a slashdot effect to your product information pages?
Or not...
Hmmm, as nice as Zaurus FreeCiv is, it's not been updated in a year and lacks many key features that actually make the game vaguely playable. It, like many Zaurus apps, are great ideas and projects started with lots of enthusiasm but that eventually ground to a halt in a half finished state.
It's a shame.
I'll probably get some flak for this but what the hell.
I own both a Palm PDA and a Zaurus (Treo 90 and SL-5000), the former is a perfect organiser whereas I hardly consider the latter to be. My Zaurus is let down by many things, firstly the fact that there exists relatively little up to date organiser software for it that even comes anything close to many of the free Palm apps out there.
Secondly, installing some of the more interesting applications on the Zaurus requires you to jump through herculian hoops to get things working.
Lastly, people'll probably point to webpages chocked full of Zaurus applications (http://www.killefiz.de/zaurus/ being one) but one closer inspection you'll find that many of the more useful applications are either in a half finished state or haven't been maintained in several years and lack features needed to work with newer desktop versions.
Don't get me wrong, I love my Zaurus. There's nothing like pulling it out of your pocket, firing up the WiFi, ssh'ing into your box and synching your local MySQL server. Just don't buy it if you're looking for an organiser, you'll be bitterly disappointed.
- Sadiq
Can you imagine a beowul.... oh.. wait..
It's all nice and well till the technology takes off and soon they'll find the nice hole in the licensing that allows them to do it gets shut off.
Maybe i'm just cynical.
I'm shocked that this was moderated as funny, it's not. This guy's just being racist. The biggest chunk of spam I receive comes right out of the US and UK.
Same problem here! It's not just you. These people really don't like life.
I assume it's 99.99% and 99.999% uptime.
Some of you guys might want to look at VirginRadio's website (www.VirginRadio.com), they have a broadband stream (you've got to put in a password to access it, free reg though). The twist is, it's a peer to peer stream, they use a plugin by AllCast.
Apparently, what this plugin does is contact the server and obtain a list of listeners, it then find a listener with atleast a 100kbs upload capacity and connects to them, receiving their stream from them. You'd think there'd be lots of problems.. e.g, it'd be slow, you'd get your bandwidth sucked away, you'd get cut off randomly. Well.. no. I've been listenening for about three days now, i've been cut off only twice in that time and i've had somebody else connected to me most of that time as well and I didn't even notice it till I looked at my upload stats later in the day.
I'll put my money on this being the way to get around the problem, why does the server need to be the one to be dishing out all the bandwith? Why doesn't the server just serve the streams to other users, who in turn serve it to other users. Fairs fair.
Apparently the 'wrapping your number plates in shiny plastic' trick doesn't work.
Nearly all the camera's will only catch you if you're doing more than 10/15mph+ over the speed limit, so the best 'trick' to get around it is to keep your speed down. I have been flashed once (if I get two tickets in the next two years, i'll have to retake my tests [driving and theory]) for doing 45mph in a 30mph zone because some fool in the lane next to me wouldn't let me get into the right hand lane, so I could take the right turning at the round-about. Apparently the Camera's can't detect your speed if there are two cars going over the area at exactly the same time, which was probably what happened in my case.
Hiya,
I just downloaded and installed Virtual-U and i'm getting an error bitching about not being able to open RESOURCES\A_WAVE2.RES. Anyone else getting something like this?
- Sadiq
www.toao.com
I'm proud to say that us British can claim to be shafted in so far as physically possible when it comes to broadband. Let's see... what do we get for our $60/month ADSL? We get 512k downstream and 256k upstream, a 50:1 contention ratio, a telco that really really doesn't have _any_ clue what's going on and periods where you really wish you were back on a modem, and thats _IF_ you're lucky to live in an area where your exchange has been activated.
(Yes, we do have cable modems but one of the large cable telco's [Cable & Wireless] managed to shaft all of our cable network, which means NTL can't even give us a timeline for when we'll have cable access)
I have a cousin living in Tanzania who get's wireless broadband at a megabit, for less than $30/month. That's got to be taking the piss abit.
I saw a guy earlier who was complaining that a T1 cost $600 a month. Do you have any idea how much a 64k leased line costs over here? You'd be lucky to get a 128k leased line for $600 a month from BT.
Don't complain. Whatever services you've got, be happy with. If you're like me and still sitting on a 56k modem because the cachement area for the local ADSL-enabled exchange stops 3 doors down [and your's isn't enabled], THEN you have something to complain with.
Sorry if i'm just ranting, but you've got to be happy with what you've got, you don't know how much better off you have it, compared to other places.
- Sadiq Jaffer
Toao.com
Hi, To a certain extent this is slightly off-topic... but you American's have NO right to call your petrol prices high. Here in England, we pay more than triple what your paying (even at its peak). If anyone needs alternative types of fuel for cars, it's us British... Roll on cold fusion.. =)
I thought of some possible ways of preventing squatting. First, up the price of a domain, having domain hovering around the $10/year mark is stupid, people are just going to buy huge amounts at that price. Secondly, ban the resale of domains. Thirdly, a domain can only be registered if it is payed for at the time of registration, none of the way NSI used to give you a grace period to pay for the domain, which enabled squatters to register and re-register large amounts of domains, for nothing. I think implementing those would make quite a difference when it comes to domain squattings/squatters... Its a sad sad day when a webmaster can't even find a decent domain name for his website..
It might just be me, but it said that they monitor all email/fax/telephone conversations in Europe.. but doesn't that require the co-operation of the other European telcos? What about email? wouldn't that require something somewhere along the line sorting out all the email stuff? If so.. where is it? Do our ISPs know about it? (I'm in the UK) or is everything based at the telcos.. (which'd make slight sense.. fax/email/phone all go through them.. one way or another..).. It just seems wierd that something of this power and complexity isn't completely out in the open if it could do what it is supposed to do..