What is a address space of process? [closed] - unix

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Please any body tell what is meant by address space ?
why it is called like that ?
and also about the virtual memory ?
Thanks in advance
Regards
Pavankumar

I think address space refers to a segment.
In real mode (intel's XT and 286) segment is just a way to make a program independent of it's space in memory. When a program gets compiled the addresses (of varables, labels - functions) are hardcoded into a program. - This way it would be difficult to load two programs at the same time, because they would all want to use the same addresses.
We need to use relative addresses instead of absolute ones. The resolution between the relative and physical addresses are made relative to segments. If one program is loaded starting from the segment 0x200 and another program is loaded starting from 0x600 they can freely use the same address (for example 0x41) because that will be relative to their respective segments. In our case (real mode) the segment 0x200 will be translated to physical address 0x2000 (through multiplying it by 0x10) and after adding the relative address, the resulting physical address will be 0x2041.
There are many segments which can be used. Data operations by default are made relative to the program's Data Segment (held in the DS register of the cpu) and code operations are made relative to Code Sement (held in the CS register). Stack addresses are resolved to physical addresses using the Stack Segment (SS register).
But in real mode you can freely use the segments, you can access other program's segments or enter arbitrary values which will be resolved to arbitrary physical addresses.
In protected mode the whole concept changed. Segments do not hold addresses any more. They hold selectors. They only refer to an element in a table, where the real base addresses are held. The table also contains limits, so you can no longer address ANY physical address, only inside the portion of memory which was given to your program by the OS. This introduces the concept of ownership of memory blocks by processes.
I think this is enough for the start, feel free to read more on either Wikipedia or other good sources. The topic is quite documented.

Related

explicitly defining variable addresses (in Go) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Simplified Question:
Is it practical for a programmer to keep track of the addresses of variables, so that a variable's address can be used as a point of data on that variable?
Original Question:
I am attempting to wrap my head around how variables are stored and referenced by address using pointers in Go.
As a general principal, is it ever useful to assign a variable's address directly? I can imagine a situation in which data could be encoded in the physical (virtual) address of a variable, and not necessarily the value of that variable.
For instance, the 1000th customer has made a 500 dollars of purchases. Could I store an interger at location 1000 with a value of 500?
I know that the common way to do something like this is with an array, where the variable at position 999 corresponds to the 1000th customer, but my question is not about arrays, it's about assigning addresses directly.
Suppose I'm dealing with billions of objects. Is there an easy way to use the address as part of the data on the object, and the value stored at that location as different data?
for instance, an int at address 135851851904 holds a value of 46876, 135851851905 holds 123498761, etc. I imagine at this point an array or slice would be far too large to be efficient.
Incidentally, if my question due to a misunderstanding, is there a resource someone can provide which explains the topic in deep, but understandable detail? I have been unable to find a good resource on the subject that really explains the details.
is it ever useful to assign a variable's address directly?
You can use the unsafe package to achieve that but the idea is that you don't do it unless you have a concrete and otherwise unsolvable use-case that requires it.
Could I store an interger at location 1000 with a value of 500?
As mentioned before it is possible but choosing an arbitrary address won't get you far because it may not even be mapped. If you write to such a location you'll get a access violation (and your program will crash). If you happen to hit a valid address number you'll likely be overwriting other data that your program needs to run.
Is there an easy way to use the address as part of the data on the object, and the value stored at that location as different data?
In general no.
If you managed to build some kind of algebraic structure closed under the operations by which your own pointer-arithmetic is defined in a finite set of addresses which you can guarantee to always be a valid virtual memory segment then yes but it defeats the purpose of using a garbage collected language. Additionally it would be hell to read such a program.

Radio Frequency Triangulation (Positioning) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I'd like to know if it's possible to somehow triangulate (or otherwise) get a location of a moving object inside a defined area, let's say, 200m x 200m, by using radio waves.
I've been looking at some transceivers and the range shouldn't be impossible (budget doesn't really matter). What would i need? Is there some reading material out there about this?
What i thought about was having a few "Antennas" positioned around the defined area, listening for the RF signal from the moving object - and then somehow calculate the distance from the object to the antenna, and that way get the exact location of the object by combining the data from all antennas.
Is this somehow possible, anyone care to point me in the right direction?
Thanks a lot guys.
Edit: Forgot to mention that the accuracy wouldn't have to be so precise, maybe ~15cm?
Phased antenna arrays are used for beamforming: sending a signal in a certain direction and estimating direction of arrival.
DOA and a several antenna arrays could be used for Localization, which is what you are looking for. This source explains that 2D localization can be performed with 3 receivers using only the TDOA information.
I'm not sure if its practical or applicable to the problem you want to solve, just an avenue for investigation.
well, similar question was posted on this link, you can definitely give it a shot... https://electronics.stackexchange.com/questions/8690/signal-triangulation
Personally I think, if your target area is really like within 200m X 200m you can take a look at RFID based solutions. Passive RFID systems utilize something called a Received Signal Strength Indicator (RSSI) to determine how close an object is to an RFID reader. RSSI can't tell you the exact range, but you can surely find out if it is getting near or far. I have seen RFID systems being used to identify the loading of trucks in a given area roughly the same size as your requirement.
The only caution is if you are using multiple tags on an object for the directivity of target then RFID wont be so accurate as the RSSI level from different tags wont give a conclusive result.
Phased array system is highly accurate, but its a tad costly to implement.
You can find some reference documents in this article. It has good collection of RF ranging and Direction Finding manuals.
There's quite a lot of academic papers out there on this, e.g. scholar search and products, e.g. ekahau. The simplest to have a go with is probably trilateration with hardware that reports an RSSI, which you use to infer distance. Time difference of signal arrival is another level of accurate and tricky.
A lot of these techniques are quite sensitive to the environment: 15cm accuracy in open space, with sufficient receivers, is doable. If you add walls, furniture and people it gets harder. Then you need to survey the site for what a beacon in that location looks like; add in the variation depending on where a user with the device is (big bags of water block radio); and then interpolate between places.
You have an arduino tag on your question. I'm not sure what the significance of this is, but as above - do check what data you can get from your hardware.
I am not not sure about RF & Antennas, BUT, having multiple cameras ( whose relative position is known ) looking at the same object this can be achieved using structure from motion

Have anyone tried to break a bit even smaller? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I was reading a book regarding to learn more about ASM, and the author happened to commented on bits, the exact quote is:
A bit is the indivisible atom of information. There is no half-a-bit, and no bit-and-a-half. (This has been tried. It works badly. But that didn't stop it from being tried.)
My question is when have this been tried? What was the outcome? How did it go badly? It bothering me that google isn't helping me find the answer to this question regarding on the cases when someone tried to make a half a bit and use(?) it.
Thank if you can find out when this case happened.
Yes. That's what arithmetic coding (a type of compression) is about. It allows information to be stored in fractional bits.
I believe that in the specific example you're talking about, that the author was merely being tongue in cheek, and not referring to any actual attempt to split bits.
A bit, as defined by present day computers, is a binary value 0 or 1. That is the 'atom' of information, because in binary logic you cannot represent anything other than that using a single 'bit' - to represent anything else, like 0.5, you need more 'bits'.
However for multilevel electronics, the 'bit', would have multiple values. If someone makes a computer, which has electronics where each 'bit' can take value between 0-9, then you have a bit that can store more than just 0/1. Perhaps the author meant this. Attempts to make computers with multi level bits have failed, 'miserably'. Electronics has not been able to figure out how to do that, in a reliable/cost effective fashion. e.g. if someone can figure that out, then say a 1024 bits memory would have a single cell, the cells taking on a value ranging from 0-1023 to signify the value. That chip would then by 1024 times smaller than the current chips (just theoretically - if everything else remains the constant).
Though admittedly at a physical level, a bit would still remain as a bit. That is 1 wire going into a chip. That is 1 gate input. That is 1 memory cell. If you divide that 1 wire, 1 input, or that one cell into two, you get two wires/inputs/cells, NOT half wire/input/cell. So you get two bits.
I believe the author tries to state a metaphysical fact with humour.
Data is commonly stored using multilevel voltages in magnetic discs and flash memory. However one can calculate the "optimal" base of a number system being 'e=exp(1)=~2.718...', which AFAIK hasn't been "tried", while ternary (base-3) system is quite common in fast parallel arithmetic algorithms and it works better than base-2 in many applications.
Also, as omnifarious states, arithmetic/range encoding can be seen as a method of using fractional bits: e.g. if there are only three possible messages (e.g. 001, 010, 100), those can be stored in two bits "leaving one quarter of the space" unused.

Why some people say Riak is eventual consistent [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
In Riak by default data bucket are replicated to 3 different nodes (N=3). Also number of replicas that must respond to a read or write request before it is considered successful are 2 nodes (R=2, W=2).
We know when N is small or equal to R+W, Riak provides strong consistency. So by these default value Riak provides a strong consistency (like MySQL). I can't underestand why some people tell Riak is not strong consistency and it provides an eventual consistency?
R and W values (together with PW (primary write), PR (primary write) and DW (durable write)) allows you to tune consistency according to your application's requirements. Even though this can guarantee consistency during normal operation, Riak is still eventually consistent due to how it handles failure scenarios like e.g. network partitioning.
If we assume we have a cluster of 5 nodes with N set to 3 and 2 nodes are partitioned from the rest for some period of time, all nodes will still be able to accept both read and writes according to the previously mentioned parameters. If we further assume PR and PW are set to 0, records can be updated on both sides of the partition while it is in place. This can cause inconsistencies that can not be resolved until the cluster connectivity is restored, thus making the system eventually consistent.
PR and PW allows the user to specify that a certain number of primary partition owners must be present in order for the read/write is to succeed, and if these are set to a value > 0, it is possible that a partitioned cluster may not allow reads/writes to all objects on all nodes during the time the network partition persists.
A better term for what Riak and similar systems offers might be tunable consistency, since they offer the ability to make decisions about the tradeoffs between consistency, availability, and partition tolerance. MySQL and other RDBMS systems, by contrast, go to great lengths to guarantee consistency. This is an expensive guarantee that isn't always worth the cost.

VB.NET Application Blocks [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
What are the limitations of using ApplicationBlocks (An Introduction and Overview of the Microsoft Application Blocks) for ASP.NET/VB.NET applications? I have found lots of websites that talk about the benefits e.g. divorcing the data tier from the web tier, but I cannot find a web page that discusses the limitations.
I don't think you can really get a plain list of disadvantages. Microsoft Enterprise Library is a good library, well documented, rich and with tons of features.
You should change your question to "When I do not need to use it?". Of course this question should be repeated for each block. I'll try to summarize a little bit.
For every block you should consider to do not use the library when you do not need its complexity. Features doesn't come without a cost and the most obvious one is complexity (first in deploying and configuration). If you have to document and your user have to change application's configuration you may need to provide some tool or a lot of documentation. Complexity can be hidden in code too, even if EL designers tried to make everything easy it can't be as easy as a raw solution.
Second important disadvantage is obviously the speed. Layers of abstraction can't be for free and you'll pay a speed cost for that. In some cases you may do not care (simple Logging, for example) but it may be a problem in other cases (so again the answer is "it depends"). Think, for example, to Unity Application Block: you'll get all the power of injection but you'll pay a great cost for this.
So when you should use it? In my opinion a big goal of this library is that you do not need to use it all together. You can pick blocks you need when you need them. It's very common, for example, to use Logging and Exception Handling but you may not need Unity in whole your life. The Data Access Application Block is a very thin layer above ADO, it simplifies many common tasks but you do not gain the level of abstraction you have, for example, with LINQ to SQL or Entities (hey, do not forget they have very different purposes) and you should consider to use it only if everything else can't suit what you need.
So, finally, in my opinion you should consider each block and use it only and only if you really need all the complexity that comes with an Enterprise level library. It's not designed for small single user applications (even if sometimes you may find that some Application Blocks may be great for a specific task). Its drawbacks aren't little: complexity and speed can't be ignored (both for short term solution and long term maintenance plans). Moreover if you really need all its power you'll find it's not as easy as a "ready-to-go" solution, to have the control you'll need to write more code.

Resources