Search Results

Search found 341 results on 14 pages for 'atomic'.

Page 7/14 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • gcc compiling error on Solaris 10

    - by osman toker
    I want to compile a source code, but there are some compiling errors about __sync_xxx functions (__sync_bool_compare_and_swap etc.) GCC version on machine is 3.4.3 (it must be gcc 4.1 or over for supporting atomic builtins), so I have downloaded GCC v4.6, copied it to another directory (I didn't remove v3.4.3) then change the $PATH path for GCC but it doesn't work (the same error occurs). I want to ask that is only changing gcc path with export PATH=... enough for compiling with new GCC?

    Read the article

  • Android Eclipse test projects cannot be used with a project being built in an Android build tree

    - by orospakr
    An Android Java project placed in a git repository and built in an Android tree in /packages/apps needs to have the project files located at the root of the git repository. This is problematic for creating a complementary Test project, which should ideally be included in the same git repository so commits are atomic for both code and tests. Eclipse gets very unhappy if you include the Test project as a subdirectory. Is there an appropriate approach for dealing with this other than creating a second repository?

    Read the article

  • Disk based HashMap

    - by synic
    Does Java have (or is there a library available) that allows me to have a disk based HashMap? It doesn't need to be atomic or anything, but it will be accessed via multiple threads and shouldn't crash if two are accessing the same element at the same time. Anyone know of anything?

    Read the article

  • ARM cortex: mutex using bit banding

    - by Jeff V
    Given that, on the ARM Cortex M3, I can: atomically read a single bit atomically set a single bit atomically clear a single bit How can I combine these for a mutex style set of operations: try lock take lock release lock It seems that try_lock or take_lock would require two operations that would not be atomic. Do I need more control to accomplish this? Disable global interrupts would do it but it seems there should be a more surgical approach.

    Read the article

  • Any chance to get Core Data using Tokyo Cabinet as the persistent store?

    - by dontWatchMyProfile
    I watched a free high quality video with Aaron Hillegass about Core Data vs Tokyo Cabinet. Besides that this guy is amazingly funny (really, if you want to laugh now, watch it!), he shows off Tokyo Cabinet beeing about 40x faster than Core Data. I wonder if it's worth thinking about how to attach this to Core Data? Does that make any sense? Maybe as a custom atomic store or something like this?

    Read the article

  • Is there an open source UIView subclass for creating multiple, dynamic tabs in the iPhone (iPad) SDK

    - by smountcastle
    Is there an open source UIView component that supports multiple, dynamic tabbed views for the iPhone (iPad) SDK? I see several apps in the iPad App Store which utilize tabs, one such example is the Atomic Web Browser which provides a tabbed browsing experience (like Safari on the Mac or Firefox). Instead of reinventing this functionality, I'd like to reuse an existing component.

    Read the article

  • Is there an open source UITabbedView component available for the iPhone (iPad) SDK?

    - by smountcastle
    Is there an open source UIView component that supports multiple, dynamic tabbed views for the iPhone (iPad) SDK? I see several apps in the iPad App Store which utilize tabs, one such example is the Atomic Web Browser which provides a tabbed browsing experience (like Safari on the Mac or Firefox). Instead of reinventing this functionality, I'd like to reuse an existing component.

    Read the article

  • Mysql concurrency: what happens if a locked table is accessed?

    - by PixelSapiens
    the question is rather simple but I couldn't find a precise answer: in a myisam db, what happens if a php file locks a table (with an atomic operation, say an INSERT) and another php file tries to access the same table (reading or writing)? Now, while it is obvious that the second session will not be able to access the table, what exactly happens? Does it return some kind of error? Does is wait in queue until it is able to access it? Thanks in advance!

    Read the article

  • Hide public method used to help test a .NET assembly

    - by ChrisW
    I have a .NET assembly, to be released. Its release build includes: A public, documented API of methods which people are supposed to use A public but undocumented API of other methods, which exist only in order to help test the assembly, and which people are not supposed to use The assembly to be released is a custom control, not an application. To regression-test it, I run it in a testing framework/application, which uses (in addition to the public/documented API) some advanced/undocumented methods which are exported from the control. For the public methods which I don't want people to use, I excluded them from the documentation using the <exclude> tag (supported by the Sandcastle Help File Builder), and the [EditorBrowsable] attribute, for example like this: /// <summary> /// Gets a <see cref="IEditorTransaction"/> instance, which helps /// to combine several DOM edits into a single transaction, which /// can be undone and redone as if they were a single, atomic operation. /// </summary> /// <returns>A <see cref="IEditorTransaction"/> instance.</returns> IEditorTransaction createEditorTransaction(); /// <exclude/> [EditorBrowsable(EditorBrowsableState.Never)] void debugDumpBlocks(TextWriter output); This successfully removes the method from the API documentation, and from Intellisense. However, if in a sample application program I right-click on an instance of the interface to see its definition in the metadata, I can still see the method, and the [EditorBrowsable] attribute as well, for example: // Summary: // Gets a ModelText.ModelDom.Nodes.IEditorTransaction instance, which helps // to combine several DOM edits into a single transaction, which can be undone // and redone as if they were a single, atomic operation. // // Returns: // A ModelText.ModelDom.Nodes.IEditorTransaction instance. IEditorTransaction createEditorTransaction(); // [EditorBrowsable(EditorBrowsableState.Never)] void debugDumpBlocks(TextWriter output); Questions: Is there a way to hide a public method, even from the meta data? If not then instead, for this scenario, would you recommend making the methods internal and using the InternalsVisibleTo attribute? Or would you recommend some other way, and if so what and why? Thank you.

    Read the article

  • Two Phase Commit with MongoDB

    - by mattcodes
    Heres what Im thinking. Do you see any issues with this workaround to emulate 2 phase commit when using something like MongoDB where each operation is atomic and there is no support for transactions outside of that? transaction_scope: read message from servicebus - UpdateCustomerAddress get customer aggregate from docdb, replay events where commited =1 call customer.updateAddress validates creates customer address updated event apply event event store as uncommitted events do optimistic concurrency update against docdb pushing uncommitted events (single op to ensure consistency) publish event to service bus update docdb set events just published to commited = 1 (again one 1 op - at least in mongodb) transaction_complete

    Read the article

  • how do i know how many clients are calling my WCF service function

    - by ZhengZhiren
    i am writing a program to test WCF service performance in high concurrency circumstance. On client side, i start many threads to call a WCF service function which returns a long list of data object. On server side, in that function called by my client, i need to know the number of clients calling the function. For doing that, i set a counter variable. In the beginning of the function, i add the counter by 1, but how can i decrease it after the funtion has returned the result? int clientCount=0; public DataObject[] GetData() { Interlocked.Increment(ref clientCount); List<DataObject> result = MockDb.GetData(); return result.ToArray(); Interlocked.Decrement(ref clientCount); //can't run to here... } i have seen a way in c++. Create a new class named counter. In the constructor of the counter class, increase the variable. And decrease it in the destructor. In the function, make a counter object so that its constructor will be called. And after the function returns, its destructor will be called. Like this: class counter { public: counter(){++clientCount; /* not simply like this, need to be atomic*/} ~counter(){--clientCount; /* not simply like this, need to be atomic*/} }; ... myfunction() { counter c; //do something return something; } In c# i think i can do so with the following codes, but not for sure. public class Service1 : IService1 { static int clientCount = 0; private class ClientCounter : IDisposable { public ClientCounter() { Interlocked.Increment(ref clientCount); } public void Dispose() { Interlocked.Decrement(ref clientCount); } } public DataObject[] GetData() { using (ClientCounter counter = new ClientCounter()) { List<DataObject> result = MockDb.GetData(); return result.ToArray(); } } } i write a counter class implement the IDisposable interface. And put my function codes into a using block. But it seems that it doesn't work so good. No matter how many threads i start, the clientCount variable is up to 3. Any advise would be appreciated.

    Read the article

  • DOM Storage and locks

    - by user535759
    Since DOM storage and its equivalencies persist in between tabs and windows, I've thought about using it for message passing. The problem is that fetch and store are different operations, and therefore not atomic. I have models that rely on UUID generation, conflict resolutions, and beaconing to do the small subset of what I need to do, but my real question is this: Since the local storage is a shared memory resource, what are the locking mechanisms available for mutual access?

    Read the article

  • How to influence linebreak in Android Textview

    - by Lord Flash
    I have an Appwidget displaying days until an event like: eventname (-231 days) If possible I want to display this String in one line. If the eventname is too long I want to display the full term in braces into a new line. So that it is like: longeventname (-231 days) instead of: longeventname (-231 days) (or anything similar) Is there a way to archive this? Can I make (-231 days) "atomic"? string.getLength won't work since the size of the widget will vary by device.

    Read the article

  • c++ volatile multithreading variables

    - by anon
    I'm writing a C++ app. I have a class variable that more than one thread is writing to. In C++, anything that can be modified without the compiler "realizing" that it's being changed needs to be marked volatile right? So if my code is multi threaded, and one thread may write to a var while another reads from it, do I need to mark the var volaltile? [I don't have a race condition since I'm relying on writes to ints being atomic] Thanks!

    Read the article

  • Best ways to write a method that updates two objects in a multithreaded java environment?

    - by DanielHonig
    Suppose we have a class called AccountService that manages the state of accounts. AccountService is defined as interface AccountService{ public void debit(account); public void credit(account); public void transfer(Account account, Account account1); } Given this definition, what is the best way to implement transfer() so that you can guarantee that transfer is an atomic operation. I'm interested in answers that reference Java 1.4 code as well as answers that might use resources from java.util.concurrent in Java 5

    Read the article

  • What does [a|b|c] evaluate to in Prolog?

    - by Ambrose
    The pipe operator in prolog returns one or more atomic Heads and a Tail list. ?- [a,b,c] = [a,b|[c]]. true. Nesting multiple pipes in a single match can be done similar to this: ?- [a,b,c] = [a|[b|[c]]]. true. What does the statement [a|b|c] infer about a, b and c?

    Read the article

  • nonatomic property in model class when using NSOperationQueue (iPhone)?

    - by Andrew B.
    I have a custom model class with an NSMutableData ivar that will be accessed by custom NSOperation subclasses (using an NSOperationQueue). I think I can guarantee thread-safe access to the ivar from multiple NSOperations by using dependencies, and I can guarantee that I don't access the ivar from other code (say my main app thread) by waiting until the Q has finished all operations. Should I use a nonatomic property specification, or leave it atomic? Is there a significant impact on performance?

    Read the article

  • Is this technically thread safe despite being mutable?

    - by Finbarr
    Yes, the private member variable bar should be final right? But actually, in this instance, it is an atomic operation to simply read the value of an int. So is this technically thread safe? class foo { private int bar; public foo(int bar) { this.bar = bar; } public int getBar() { return bar; } } // assume infinite number of threads repeatedly calling getBar on the same instance of foo.

    Read the article

  • Please suggest good book/website to for Threads and Concurrency?

    - by learner
    I have gone through Head First Java and some other sites but I couldn't find complete stuff related to Threads and additional concurrency packages at one place. Please suggest a book/website which covers complete Threads with more details like Synchronize and locking of objects More detailed about volatile Visibility issues in Threads java.util.concurrent package java.util.concurrent.atomic package

    Read the article

  • Need a scenario where would fail Array.ConstrainedCopy()

    - by Sir Psycho
    Hi, Just playing around with some of the APIs in .NET and I can't seem to find a way to cause Array.ConstrainedCopy() fail. According to MSDN, it's treated as an atomic operation. If it fails during the copy, the entire call fails resulting in no elements being copied as opposed to its Array.Copy() counterpart. Can someone demonstrate this or tell me how to do this?

    Read the article

  • Online ALTER TABLE in MySQL 5.6

    - by Marko Mäkelä
    This is the low-level view of data dictionary language (DDL) operations in the InnoDB storage engine in MySQL 5.6. John Russell gave a more high-level view in his blog post April 2012 Labs Release – Online DDL Improvements. MySQL before the InnoDB Plugin Traditionally, the MySQL storage engine interface has taken a minimalistic approach to data definition language. The only natively supported operations were CREATE TABLE, DROP TABLE and RENAME TABLE. Consider the following example: CREATE TABLE t(a INT); INSERT INTO t VALUES (1),(2),(3); CREATE INDEX a ON t(a); DROP TABLE t; The CREATE INDEX statement would be executed roughly as follows: CREATE TABLE temp(a INT, INDEX(a)); INSERT INTO temp SELECT * FROM t; RENAME TABLE t TO temp2; RENAME TABLE temp TO t; DROP TABLE temp2; You could imagine that the database could crash when copying all rows from the original table to the new one. For example, it could run out of file space. Then, on restart, InnoDB would roll back the huge INSERT transaction. To fix things a little, a hack was added to ha_innobase::write_row for committing the transaction every 10,000 rows. Still, it was frustrating that even a simple DROP INDEX would make the table unavailable for modifications for a long time. Fast Index Creation in the InnoDB Plugin of MySQL 5.1 MySQL 5.1 introduced a new interface for CREATE INDEX and DROP INDEX. The old table-copying approach can still be forced by SET old_alter_table=0. This interface is used in MySQL 5.5 and in the InnoDB Plugin for MySQL 5.1. Apart from the ability to do a quick DROP INDEX, the main advantage is that InnoDB will execute a merge-sort algorithm before inserting the index records into each index that is being created. This should speed up the insert into the secondary index B-trees and potentially result in a better B-tree fill factor. The 5.1 ALTER TABLE interface was not perfect. For example, DROP FOREIGN KEY still invoked the table copy. Renaming columns could conflict with InnoDB foreign key constraints. Combining ADD KEY and DROP KEY in ALTER TABLE was problematic and not atomic inside the storage engine. The ALTER TABLE interface in MySQL 5.6 The ALTER TABLE storage engine interface was completely rewritten in MySQL 5.6. Instead of introducing a method call for every conceivable operation, MySQL 5.6 introduced a handful of methods, and data structures that keep track of the requested changes. In MySQL 5.6, online ALTER TABLE operation can be requested by specifying LOCK=NONE. Also LOCK=SHARED and LOCK=EXCLUSIVE are available. The old-style table copying can be requested by ALGORITHM=COPY. That one will require at least LOCK=SHARED. From the InnoDB point of view, anything that is possible with LOCK=EXCLUSIVE is also possible with LOCK=SHARED. Most ALGORITHM=INPLACE operations inside InnoDB can be executed online (LOCK=NONE). InnoDB will always require an exclusive table lock in two phases of the operation. The execution phases are tied to a number of methods: handler::check_if_supported_inplace_alter Checks if the storage engine can perform all requested operations, and if so, what kind of locking is needed. handler::prepare_inplace_alter_table InnoDB uses this method to set up the data dictionary cache for upcoming CREATE INDEX operation. We need stubs for the new indexes, so that we can keep track of changes to the table during online index creation. Also, crash recovery would drop any indexes that were incomplete at the time of the crash. handler::inplace_alter_table In InnoDB, this method is used for creating secondary indexes or for rebuilding the table. This is the ‘main’ phase that can be executed online (with concurrent writes to the table). handler::commit_inplace_alter_table This is where the operation is committed or rolled back. Here, InnoDB would drop any indexes, rename any columns, drop or add foreign keys, and finalize a table rebuild or index creation. It would also discard any logs that were set up for online index creation or table rebuild. The prepare and commit phases require an exclusive lock, blocking all access to the table. If MySQL times out while upgrading the table meta-data lock for the commit phase, it will roll back the ALTER TABLE operation. In MySQL 5.6, data definition language operations are still not fully atomic, because the data dictionary is split. Part of it is inside InnoDB data dictionary tables. Part of the information is only available in the *.frm file, which is not covered by any crash recovery log. But, there is a single commit phase inside the storage engine. Online Secondary Index Creation It may occur that an index needs to be created on a new column to speed up queries. But, it may be unacceptable to block modifications on the table while creating the index. It turns out that it is conceptually not so hard to support online index creation. All we need is some more execution phases: Set up a stub for the index, for logging changes. Scan the table for index records. Sort the index records. Bulk load the index records. Apply the logged changes. Replace the stub with the actual index. Threads that modify the table will log the operations to the logs of each index that is being created. Errors, such as log overflow or uniqueness violations, will only be flagged by the ALTER TABLE thread. The log is conceptually similar to the InnoDB change buffer. The bulk load of index records will bypass record locking. We still generate redo log for writing the index pages. It would suffice to log page allocations only, and to flush the index pages from the buffer pool to the file system upon completion. Native ALTER TABLE Starting with MySQL 5.6, InnoDB supports most ALTER TABLE operations natively. The notable exceptions are changes to the column type, ADD FOREIGN KEY except when foreign_key_checks=0, and changes to tables that contain FULLTEXT indexes. The keyword ALGORITHM=INPLACE is somewhat misleading, because certain operations cannot be performed in-place. For example, changing the ROW_FORMAT of a table requires a rebuild. Online operation (LOCK=NONE) is not allowed in the following cases: when adding an AUTO_INCREMENT column, when the table contains FULLTEXT indexes or a hidden FTS_DOC_ID column, or when there are FOREIGN KEY constraints referring to the table, with ON…CASCADE or ON…SET NULL option. The FOREIGN KEY limitations are needed, because MySQL does not acquire meta-data locks on the child or parent tables when executing SQL statements. Theoretically, InnoDB could support operations like ADD COLUMN and DROP COLUMN in-place, by lazily converting the table to a newer format. This would require that the data dictionary keep multiple versions of the table definition. For simplicity, we will copy the entire table, even for DROP COLUMN. The bulk copying of the table will bypass record locking and undo logging. For facilitating online operation, a temporary log will be associated with the clustered index of table. Threads that modify the table will also write the changes to the log. When altering the table, we skip all records that have been marked for deletion. In this way, we can simply discard any undo log records that were not yet purged from the original table. Off-page columns, or BLOBs, are an important consideration. We suspend the purge of delete-marked records if it would free any off-page columns from the old table. This is because the BLOBs can be needed when applying changes from the log. We have special logging for handling the ROLLBACK of an INSERT that inserted new off-page columns. This is because the columns will be freed at rollback.

    Read the article

  • MySQL Daemon failed to start.

    - by matthewsteiner
    There were no updates when I ran yum update. I was trying to install php-soap (which was failing), and online I found I should run this: wget -q -O - http://www.atomicorp.com/installers/atomic.sh |sh After running that, then "yum install php-soap" ran successfuly. Then I ran yum update just to check for updates and said yes for some packages. I noticed there were some mysql ones and such. Now mysql isn't running anymore and it won't let me start it (I get "MySQL Daemon failed to start") Ideas?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >