Slashdot Mirror


User: master_p

master_p's activity in the archive.

Stories
0
Comments
4,214
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 4,214

  1. What about the forums? on Startrek.com Shutting Down · · Score: 1

    It seems like the forums will remain...for me, the most interesting part of the site was the heated discussions on everything Trek related.

  2. Re:I'm sure no one will ever read this, but on Faster Chips Are Leaving Programmers in Their Dust · · Score: 0

    Well, it's funny that they want to put parallelism in c++, but they won't put garbage collection in it.

    What good would it make if thousands of threads can share data structures, when the programmer will have the nightmare of managing object lifetime not only across modules but across threads as well?

    And let's not forget manual memory allocation is a very *costly* operation: it may take thousands of cycles to allocate a memory block...in garbage collection, allocation is usually an increment of a pointer.

    Finally, without garbage collection, memory can be fragmented so badly that the CPUs will not actually have time to compute anything, all the time will be spent in paging...copying garbage collection has the additional benefit of eliminating fragmentation.

  3. Re:Not really simultaneously. on Faster Chips Are Leaving Programmers in Their Dust · · Score: 1

    Indeed, but caching is only an optimization mechanism; it's purpose is not to multitask.

  4. Re:There's not much hope for the C++ committee on Faster Chips Are Leaving Programmers in Their Dust · · Score: 1

    Critical sections are a high level future which must be in a library. What c++ requires is a standard for atomic operations...just like the volatile keyword disallows optimizations on a memory store, there is a need for atomically reading, writing, testing and setting variables.

    Of course, each O/S provides its own set of routines (e.g. Interlocked functions of Windows), but it would be better if the language provided the primitives for atomic operations.

  5. Re:Personal computing? on Faster Chips Are Leaving Programmers in Their Dust · · Score: 1

    Have you ever sit and watched Microsoft Word repaginate a document for what it seems an endless period of time?

    Have you ever looked at your watch while you wait for a project to compile?

    Have you ever wondered why searching the Windows registry is so slow?

    Have you ever been frustrated from Windows blocking from waiting to access a problematic networking store?

    Have you ever smiled funnily when you tried to open another program while Acrobat Reader was loading its modules?

    Well, there are countless cases that personal computers need more horsepower...

  6. The cure is the Actor programming model on Faster Chips Are Leaving Programmers in Their Dust · · Score: 2, Interesting

    The cure for solving all of parallel programming problems (deadlocks, priority inversion etc) is the Actor model: each object is a separate thread, and calling a method does not invoke code, it only puts a request in the message queue of the called object. Then the thread behind the object wakes up and processes the requests.

    If an object wants a result from another object, then it obtains a future value that represents the result of the computation when it will be ready. When the caller wants the actual value, it blocks until the result is available.

    Of course, blocking on a result would cause a deadlock in recursive algorithms...therefore, objects don't wait for a result, they simply enter a new message loop at the position they wait for a result. When the result is ready, the callee wakes up the caller by putting a 'terminate current loop' message in the caller's message loop after the result is computed.

    The Actor model, implemented as described above, not only solves the problems of classical parallel programming (deadlocks, priority inversion, etc), but it also exposes whatever parallelism is there in a program.

    Synchronization is performed only in two places:

    1) when inserting/removing elements in an object's queue.
    2) when adding the current thread into the waiting list of a future value.

    Both synchronizations are implemented via spinlocks. In the case of the queue, there is no need to synchronize on all the queue, just on the edges.

    I have made a demo in C++, using Boehm's garbage collector (it is a quite complex system, it needs gc), and it works beautifully. With this model, there is no need to use mutexes, semaphores, wait conditions, or any other synchronization primitive.

    I chose C++ because:

    1) operator overloading allows future values to be treated naturally like non-future values.
    2) when waiting for a result, the waiting thread puts itself in the waiting list of the future. The nodes of the list are allocated on the stack; only c/c++ can do this, and it is crucial, because it minimizes allocation.

    Another advantage of this system is that tail recursion comes for free: when you call a method which you don't want the result of, the local stack is not exhausted, because there is no call, only a message placed in a queue.

    Patterns like the producer/consumer pattern come for free: one object simply invokes the other.

    Data parallelism comes for free: invoking a computation on an array of objects will execute the computations in parallel, on each element of the array. For example, increasing the elements of an array can take O(N) with one CPU and O(1) with N cpus.

    Of course, it is much slower on two or even four cores than the same sequential code. But given 10 or more cores, programs start to exhibit linear increase in performance, depending on algorithm of course.

    The system is much like the nervous system of an animal: signals are transmitted slowly from one nerve to another, but processing is parallel, so the organism can do many things at the same time.

    Another similarity between this system and the nervous system of an animal is that when a nerve wants to transmit an electrical signal to another nerve, the nerves must synchronize, much like there should be synchronization when an object puts a message in the object of another thread.

  7. Not really simultaneously. on Faster Chips Are Leaving Programmers in Their Dust · · Score: 1

    It happens as fast as the bus can multiplex requests from multiple CPUs.

  8. Re:Half-Life 2 Ep 3 Gameplay on Valve Plans For More Half-Life Beyond Episode 3 · · Score: 1

    Half Life was always like a movie with a little interaction. It's not a bad thing, I find it very entertaining, and it's certainly very impressive.

  9. Re:Emotionally Stunted on The Future of Love and Sex - Robots · · Score: 1

    What's love gotta do with sex?

  10. Re:So many assumptions on Does Active SETI Put Earth in Danger? · · Score: 1

    The Incan knot is partially entangled...and we still haven't figure out linear A...doing it with images is far more difficult!

  11. So many assumptions on Does Active SETI Put Earth in Danger? · · Score: 1

    First of all, the aliens have to:

    1) use visual signals in the spectrum we use for visual signals. But that might not just be the case...they might use another part of the spectrum to communicate. The concept of 'visual' may not even be defined in their world.

    2) have the same concept of 'man' and 'woman'. Otherwise, they will not be able to understand what are these moving creatures.

    3) have the same concept of power and social structure. Aliens may not have a hierarchical society structure.

    4) have relatively the same biology. Otherwise, even the simple function of moving one's hand would be incomprehensible to them.

    There are countless other assumptions, and I am too lazy to write them all. The fact is, the chance of another race that can understand we are a threat to them is so small, that it can be considered 0.

  12. Re:In one acronym: EIRP on Does Active SETI Put Earth in Danger? · · Score: 1

    We should transmit Star Trek or Star Wars then...they will not dare destroy us if they think we have warp-drive technology and energy weapons.

    Another approach would be to transmit the Original Star Trek, the Star Trek movies with Shatner and Boston Legal. After seeing what the great Shatner can do, they will double-think it to even step outside their little planet.

  13. Downhill? what downhill? on Talking With the Women Working In Games · · Score: 1

    Games is male territory, Oprah is female territory. Let's not flatten everything, shall we?

  14. Too late. on Flying Humans · · Score: 1

    Icarus did it first...

  15. There are rumors that... on LittleBigPlanet Demo Not Coming This Year · · Score: 1

    ...they are awaiting for Duke Nukem Forever to be released first...

  16. 'How are we to fix the web?' like this: on The Future of AJAX and the Rich Web · · Score: 1

    'How are we to fix the web?'

    Replace HTML with a real programming language which includes security and distributed computing primitives, and you're done.

  17. Re:"steamed hams"? on NASA Snaps Mysterious "Night-Shining" Clouds · · Score: 1

    "except the US" ...and China.

  18. Why Microsoft did not virtualize the O/S? on Microsoft Disses Windows to Sell More Windows · · Score: 1

    Originally, Windows was a single-user system. Instead of going the Unix way, they should have gone the virtual O/S way: each user, after logon, has a COPY of the system to himself/herself, and can destroy it if he/she wishes. But the original installation can not be ever destroyed.

  19. Re:op ed on Ms Windows "security" or rather the la on Microsoft Disses Windows to Sell More Windows · · Score: 1

    You forgot to say that Microsoft will also not ever produce the perfect O/S, because nobody will buy their new versions. Job security/company security == program insecurity.

  20. Space? what space? orbit is not space!!! on 2008, The Year of the Spaceship · · Score: 1

    Every time I hear the big words 'space', 'space tourism', 'commercial space flight' etc I can't stop thinking how limited we are in our capabilities. Going to space means being able to visit at least our companion planetoid, the Moon, but we can't even do that...

  21. They force us to have two cellphones on Number of Cellphones Now Equal To Half the Human Species · · Score: 1

    Cellular telephony companies force us to have two cellphones (or more) due to their packages: in order to speak cheaply, you have to buy a specific package not available by your phone company but by another company; and in order to get away with the hassle of switching cards, it's easier to buy a 2nd device, which usually comes as an added bonus with the cheap package.

    Some people even have 3 phones: two personal (one generic, one with the cheap program), and one given by the company they work in.

  22. Re:Priorities... on First Details of Manned Mars Mission From NASA · · Score: 1

    Why is the parent modded flamebait? he/she is correct. Money spent on war are money NOT well spent. There are other issues besides war and going to Mars.

  23. Re:Give me a break... on First Details of Manned Mars Mission From NASA · · Score: 1

    Can't they just use transporters?

  24. 24 years in nothing on First Details of Manned Mars Mission From NASA · · Score: 1

    It took humanity more than 10,000 years to go from primitive societies to crossing the oceans...24 years to cross a vast space area to go to another planet, is, very very very little.

    I know, we all would like (I put myself in) to see the space era, where spaceships zoom to and from Mars and other planets.

    It doesn't going to happen for our generation, but it will in future ones. We are just not the lucky ones...but 24 years is an extremely small time period for such a big job.

  25. Re:The sad thing is... on First Details of Manned Mars Mission From NASA · · Score: 1

    Famine, wars, violence and terrorism are not born out of thin air, you know. The countries that have these problems are all very rich in natural resources...yet they starve, they fight, they are killed. Why?

    Could it be that someone else steals their resources?