what is a thread of execution?
485043
Most programs have a starting point, follow an\nexecution path through the program, and finally\nhave an ending point.  These programs only have\na single "thread of execution".  Consider the\nsituation, however, where there is a "fork in the\nroad", and your program execution splits and\ngoes down *both* paths at the same time.\n\nIt's a more difficult model to engineer (since you\nhave to take care that the two executing components\ndon't interfere with each other), but it enables\nus to either logically partition a problem (ie. into\nproducer/consumer) or physically partition a problem\n(ie. onto the distinct hardware cores available\nfrom current processors).\n\nPeople sometimes use this phrase to cover both the\ncase of two "threads" (which share almost everything\nwithin a single process) as well as the case for\ntwo cooperating processes (which share almost nothing\nsince they are distinct processes).\n\nThe wikipedia reference in the previous answer is a great\nresource, but I thought this might be a more gentle\nintroduction.
377667
heres some code from a old ASP.NET application I found (the database connection string should be 1 line)\n\nDim Public DBS as String = "PROVIDER=Microsoft.Jet.OLEDB.\n4.0; DATA Source=c:&#92;DataBase.mdb"\n\n\n\nDim myconnection as oleDbConnection = new oleDbconnection(DBS)\nmyConnection.open()\nDim myCommand as oleDbCommand = New OleDbCommand("Select * from Threads", myConnection)\nDim myDataReader as oleDbDataReader = myCommand.ExecuteReader()
320594
Nothing.\n\nA multiprocessor system IS a multi-tasking operating system.\n\nBut a multi-tasking system isn't always a multi-processor system.
107495
Hello. It's free application which enhance the performance of your PHP scripts. It increases runtime performance up to 40%.
132075
There is a good explanation on wikipedia:\n\nhttp://en.wikipedia.org/wiki/Semaphore_%28programming%29
1160141
Can you be more specific? What exactly are the problems you're running into? If you're getting null handles, what do you get when you call GetLastError?\n\n-- EDIT --\n\n>The HWND returned by CreateWindow() is NULL, \n> but GetLastError() returns 0.\n\nThat is very odd. I'm afraid I can't help debug without seeing more of the code. Some things you might keep in mind:\n\n- GetLastError refers to the last win32 call, so if you're doing anything between the CreateWindow call and GetLastError you could be clobbering your result.\n\n- If your window procedure doesn't handle certain messages, such as WM_CREATE correctly, Bad Things can happen. You should check to see if it's being entered and that messages are being properly routed by your message loop.\n\n- Make sure the hInstance you pass in is for the correct module. You want the library you're using, not the main executable... see updated references for a blog post that may be relevant to you.\n\n- You may want to eliminate the thread as the cause of the problem... if you create this window in the main application thread (ignoring for a moment that this probably doesn't make sense in the context of your app), does the code work then? If so, does it work in a thread in the main application executable (rather than in your library)?\n\nGood luck.
1124190
There are 2 different methods, either by Interrupt or by Polling.\nBy Interrupt means, every event will be sent to the CPU (the interrupt), whereby the interrupt handler checks where from the event is coming, and depending on the priority the event will be treated immediately (in case the event has the higher priority than the current process) or will be postponed (in case the event has the equal or a lower priority than the current process).\nBy Polling means, every input/output card will be scanned periodically (every 1ms, 10ms or what else) and in case there is a status change compared to the previous status, the changes will be treated immediately.\n(sorry, this is a very rough description)
601218
stmt = connection.createStatement();\n\n// check from User_tables data dictionary table \n//to see if the table exists.\nrset = stmt.executeQuery(" SELECT Table_Name FROM\n                           User_Tables "+ \n                         " WHERE Table_Name='XYZ'");    \n\n// if the resultset of the above query \n//does not have any record, \n//it means table is not existing.\nif (!rset.next())\n{\n          //operation to do if table doesn't exist\n}\nelse\n{\n          //operation to do if table exists\n}
397803
/*\n\ni need to know an example of writting a program in c\nlanguage under linux using threads?\n\nwrite aprogram to calculate the result of the equation\nY=3sin(x)+6cos(x)+5x2 so each term accomplished by a\nthread. The main thread will calculate the result.\n\n*/\n\n\n#include <pthread.h>\n#include <math.h>\n#include <stdlib.h>\n#include <stdio.h>\n\n/* static global location -- all threads will read */\nstatic double x;\n\nstatic void*\nthree_sinx(void*p)\n{\n  double* result = (double*)p;\n  *result = 3 * sin(x);\n  return 0;\n}\n\nstatic void*\nsix_cosx(void*p)\n{\n  double* result = (double*)p;\n  *result = 6 * cos(x);\n  return 0;\n}\n\nstatic void*\nfive_x_squared(void*p)\n{\n  double* result = (double*)p;\n  *result = 5 * x * x;\n  return 0;\n}\n\n/*\n *\n * Y = 3sin(x) + 6cos(x) + 5x2\n *\n */\n\nint\nmain(int argc, char* argv[])\n{\n  double result[3]; /* one location for each thread */\n  pthread_t tid[3];\n  void *r;\n  int i;\n\n  /* Set "x" to double value passed in on command line */\n  x = argc>1 ? strtod(argv[1], 0) : 0;\n\n\n  /*\n   *  Since result areas are distinct, no mutex needed\n   */\n  if (pthread_create(&tid[0], NULL,\n    three_sinx, &result[0]) != 0) {\n    perror("pthread_create[0]"), exit(-1);\n  }\n\n  if (pthread_create(&tid[1], NULL,\n    six_cosx, &result[1]) != 0) {\n    perror("pthread_create[1]"), exit(-1);\n  }\n\n  if (pthread_create(&tid[2], NULL,\n    five_x_squared, &result[2]) != 0) {\n    perror("pthread_create[2]"), exit(-1);\n  }\n\n  /* Synchronize on the completing child threads */\n  for (i=0; i<3; i++) {\n    if (pthread_join(tid[i], &r) != 0) {\n      perror("pthread_join");\n      exit(-1);\n    }\n  }\n\n  /* main thread will now combine the result */\n  printf("For y=3sin(x)+6cos(x)+5x2, when x=%f, y=%f&#92;n",\n      x, result[0]+result[1]+result[2]);\n\n  return 0;\n}\n\n\n\nTo show that it works:\n\n$ cc pthr.c -lpthread -lm\n\n$ a.out 3.14159\nFor y=3sin(x)+6cos(x)+5x2, when x=3.141590, y=43.347947\n\n$ a.out 0\nFor y=3sin(x)+6cos(x)+5x2, when x=0.000000, y=6.000000
579916
Many things can do this.\n\nYour computer hangs when a program is waiting for something to be processed.  When programming, it is important to make sure that the bits of information that need to be processed are small enough so that the delays are short.\n\nAs far as errors, you will need to ask a specific question about a specific error.
736487
Whenever a function is called, the current context(like line no., variables value, etc.) of the execution get pushed in STACK  MEMORY area of RAM and when the function returns it pops the current context and resumes the execution. When u call the function multiple times inside another, then the stack memory may exhaust with the context value, then this is called as stack overflow.\n\nIt generally occurs when the recursion functions are poorly written.
683459
Concurrent processing means processing 'at the same time'.\n\nAn example of this is the spellcheck feature in Microsoft Word.\n\nIt is happening (in the background) at the same time as you are editing your document.\n\nNB Unless you are using a machine with multiple processors (CPUs) and the application is capable of multi-threading, then the chances are it is just the illusion of concurrent (or parallel) processing
1023405
Not that I know of. I use good old C++ to do molty threading and dual core programing. I wish they would come up with one I am tired of all the extra work needed to lock resources.
553841
In a nutshell, a process can contain multiple threads. \n\nIn most multithreading operating systems, a process gets its own memory address space; a thread doesn't. Threads typically share the heap belonging to their parent process. \n\nFor instance, a JVM runs in a single process in the host O/S. Threads in the JVM share the heap belonging to that process; that's why several threads may access the same object. \n\nTypically, even though they share a common heap, threads have their own stack space. This is how one thread's invocation of a method is kept separate from another's. \n\nThis is all a gross oversimplification, but it's accurate enough at a high level. Lots of details differ between operating systems. \n\nWith love
300000
You don't say where it happens. Always give as much info as you can, computers are very complicated machines, and there are millions of pireces of software running around.\n\n- If you that's an error in a program you wrote, you are using a variable as an object when it is not (it is probably a native type, or null)\n\n- If that's an error from software you didn't write, they shipped it with a bug, and there's not much you can do except report it and try to work around it...
150130
this is pointer to invoking object in Javascript.\nSo you're passing current object for update to a function in your code. \nThere are also some alternate ways (document.form.xxx) to reference to current object, but this is simple and to the point when you just want to change the object from where you're making method invocation.
403214
In computer science, a lock is a synchronization mechanism for enforcing limits on access to a resource in an environment where there are many threads of execution. Locks are one way of enforcing concurrency control policies.\n\nA (binary) semaphore is the simplest type of lock. No distinction is made between shared (read only) or exclusive (read and write) modes. Other schemes provide for a shared mode, where several threads can acquire a shared lock for read-only access to the data. Other modes such as shared, exclusive, intend-to-exclude and intend-to-upgrade are also widely implemented.