What threading pratice is good 90% of the time? [closed] - multithreading

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 12 years ago.
What practice or practices are good 90% of the time when working with threading with multiple cores?
Personally all i have done was share immutable classes and pass (copy) data to a queue to the destine thread.

This is very vague - but there are a few basic precepts I'd always follow:
Make sure threading makes sense before you implement it
Focus on algorithms, not individual lines of code when designing for threading
Thread at the highest level possible
Prefer immutable data
Synchronize data access appropriately
Prefer high level threading libraries over low level, hand written threading code
Measure (make sure 1. was true!)

Related

How do I create a PSP emulator? [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 know that I need to know at least C and Assembly. In your own opinion what else does one need to know apart from knowing how to program in C and Assembly efficiently? Are there any books you can suggest to get me started? I also read that you need to know about the hardware architecture of the platform you are emulating. Would you also recommend the books listed here?
For experts only
You would have to know all the inner workings and hardware details of PSP, which are business secrets of Sony and therefore not published. The way most emulators are made is reverse engineering, a process in which the device itself is disassembled and its inner workings are studied. That includes analyzing the chips thoroughly, reading the contents of ROM chips and sometimes even deciphering encrypted data. Full analysis usually requires specialized equipment and years of engineering experience.

i want to find out how many threads maximum use in dual core using C# [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 am using C#. I want to write the program using thread concept. I just to know maximum how many threads can run in dual core using C#. I attach my partial code:
Thread t1 = new Thread(threadJobA);
Thread t2 = new Thread(threadJobB);
t1.Start();
t2.Start();
You can use the Environment.ProcessorCount to find out how many cores there are in the machine.
However, that doesn't limit the number of threads that you can start, that only tells you how many of the threads can run at the same time. In some situations there may be useful to start more threads than that, in some sitations less. It all depends on what the threads are supposed to be doing.

Thread Synchronization Primitives [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 am looking for a good material on different thread synchronization primitives that are generic (not tied to any language or implementation. I only want the concepts).
Searches in the internet point to specific language or implementation.
Well, it will be hard to find such resources, because they are almost always accompanied with some (at least pseudo) code example. Unless someone better informed than me sees this question :)
I would suggest exploring wikipedia for starters, e.g.:
Producer consumer problem
Dining philosophers problem
Sleeping barber problem
Synchronization (computer science)
Inter-process communication
look at the linked general words, links and external links, once you get familiar enough in the desired direction it would be ideal to find a scientific article that covers the topic - they are full of many references, and evenutally you'll stumble upon some great article(s).

Verilog simple cpu doesn't work [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 am trying to create a simple cpu using verilog but i couldn't.
I am using a logisim circuit as starting point.
To debug Verilog code problems, you need to create testbench stimulus code and run simulations.
The diagrams you linked to are too difficult to read. Since you didn't provide any of the submodules, no one can compile your code. You didn't describe what output you are getting and how it differs from what you expect.
Break your problem down into smaller pieces and start debugging each individually.
You're using blocking assignments exclusively which can cause problems with sequential logic. If this is a Xilinx FPGA there are coding guidelines. As toolic said, you need to make a testbench and simulate your design.

Multicores and mulithreads [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 11 years ago.
If a software devoloped with multi threading , Is it true that multicore processor executes that software efficiently by using software threads of operating system i.e when i create multiple threads in java those threads are exicuted simultineously by multicore processor by linking these java threads with software threads of OS ?
It varies with the JVM implementation and OS, but when coding you should take a defensive position and assume that multiple threads will be active at the same time.
Pragmactically, you will see good use of multiple cores on many major platforms. There's quite a bit of cleverness in commerical JVMs now to do garbage collection so as to reduce the impact of that on muti-core platforms.

Resources