Pointers & InterLocked

本文介绍了如何在Unity的Job System中利用指针和Interlocked类解决并发计数问题。首先展示了简单并行计数存在的问题,如值传递导致的错误和线程安全问题。然后通过使用NativeReference和NativeArray解决值传递问题,并通过线程本地存储避免竞争条件。最后,引入了unsafe关键字和Interlocked类,以原子操作确保线程安全,实现了高效并行计数。

Pointers & InterLocked

这一节我们来改造一下最开始的 CounterJob 利用IJobFor接口开实现并行求和。
我们先来一个Naive版本,来一起思考一下这个Job中的问题:
    
public struct NaiveParallelCounterJob : IJobFor { [ ReadOnly ] public NativeArray < int > data ; public int sum ; public void Execute ( int index ) { sum += data [ index ] ; } }
这个实现中我们只是简单的将 IJob 接口转换成了 IJobFor 接口。第一个非常明显的问题就是 sum 不是以引用的形式传进来的而是直接以值传递的形式进行了赋值,这会导致任务完成之后无法获取正确的 sum 值。这个问题在 什么是C# Job System? 章节提到过。所幸的的是Unity已经为我们提供了 NativeReference<T> 这个很方便的封装类,它允许我们以引用的方式来传递单个值。 我们一起来修正这个问题:
    
public struct NaiveParallelCounterJob : IJobFor { [ ReadOnly ] public NativeArray < int > data ; public NativeReference < int > naiveSum ; public void Execute ( int index ) { naiveSum . Value += data [ index ] ; } }
我们解决了传引用的问题,接下来大家思考一下, IJobFor 接口中的 Execute() 方法可能会运行在不同的Worker线程中,在这种情况下我们对 naiveSum 变量的访问就会存在竞争条件(race condition),如果我们直接执行这段代码,Unity的Safety System就会向我们报告一条错误:
    
InvalidOperationException : NaiveParallelCounterJob . naiveSum is not declared [ ReadOnly ] in a IJobParallelFor job . The container does not support parallel writing . Please use a more suitable container type .
我们该如何修正这个错误呢?
很自然的,我们可以联想到上一节的线程本地存储(Thread Local Storage),我们将上一节TLS实现搬运到ParallelCounter中就得到了下面的代码:
    
public struct ThreadLocalParallelCounterJob : IJobFor { //input [ NativeDisableParallelForRestriction ] public NativeArray < int > data ; //output [ NativeDisableParallelForRestriction ] public NativeArray < int > sums ; [ NativeSetThreadIndex ] private int m_ThreadIndex ; public void Execute ( int index ) { sums [ m_ThreadIndex ] += data [ index ] ; } }
不过这个Job中我们只得到了按照线程ID分组的sum值,我们还需要另外一个Job将这些sum组合成一个TotalSum。
    
public struct TotalSumJob : IJob { [ ReadOnly ] public NativeArray < int > sums ; public NativeReference < int > totalSum ; public void Execute ( ) { for ( int i = 0 ; i < sums . Length ; i ++ ) { totalSum . Value += sums [ i ] ; } } }
在Job调度代码中将这两个Job以依赖(dependency)的形式串联起来。
    
var threadLocalCounterJobHandle = threadLocalCounterJob . ScheduleParallel ( m_Data . Length , 64 , new JobHandle ( ) ) ; var totalSumJobHandle = totalSumJob . Schedule ( threadLocalCounterJobHandle ) ; totalSumJobHandle . Complete ( ) ;
经过一番折腾,我们得到了一个可以正常运行的ParallelCounter。但是大家有没有注意到,上面分享的例子,跟今天的标题根本就不相关啊🤣。好,下面我们就用指针和Interlocked类来实现一下这个ParallelCounter。
Interlocked 可以为我们在不同线程之间以原子操作的方式来修改变量,这样我们就不用担心竞争条件(race condition)的问题了。
为了在Job中使用指针,我们需要引入一个新的属性—— [NativeDisableUnsafePtrRestriction] ,有了这个属性,我们就可以解除在Job中不能使用指针的限制,大大扩展了我们书写Job的灵活性。
下面我们给出Interlocked版本的实现:
    
public unsafe struct InterlockedParallelCounterJob : IJobFor { //input public NativeArray < int > data ; //output [ NativeDisableUnsafePtrRestriction ] public int * sum ; public void Execute ( int index ) { Interlocked . Add ( ref UnsafeUtility . AsRef < int > ( sum ) , data [ index ] ) ; } }
这里值得一提的是, Interlocked.Add() 方法需要一个 ref 变量,我们需要将 sum 指针转换成 ref 变量,而 UnsafeUtility.AsRef() 正好就是我们需要的。 UnsafeUtility 类提供了很多大家书写native代码的封装,大家有需要可以优先找一下这里是否已经有了你需要的方法实现。
【文章目录】
  1. Pointers & InterLocked
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains information that should help you find out what is causing the crash. 2025-09-15T07:56:29.816069Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2025-09-15T07:56:29.816120Z 0 [Warning] &#39;NO_ZERO_DATE&#39;, &#39;NO_ZERO_IN_DATE&#39; and &#39;ERROR_FOR_DIVISION_BY_ZERO&#39; sql modes should be used with strict mode. They will be merged with strict mode in a future release. 2025-09-15T07:56:29.817337Z 0 [Note] D:\work\w\sql\mysql\mysql-5.7.29.0\exe\MySQL Server 5.7\bin\mysqld.exe (mysqld 5.7.29-log) starting as process 11660 ... 2025-09-15T07:56:29.820886Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2025-09-15T07:56:29.821179Z 0 [Note] InnoDB: Uses event mutexes 2025-09-15T07:56:29.821378Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier 2025-09-15T07:56:29.821652Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 2025-09-15T07:56:29.821885Z 0 [Note] InnoDB: Adjusting innodb_buffer_pool_instances from 8 to 1 since innodb_buffer_pool_size is less than 1024 MiB 2025-09-15T07:56:29.822459Z 0 [Note] InnoDB: Number of pools: 1 2025-09-15T07:56:29.822749Z 0 [Note] InnoDB: Not using CPU crc32 instructions 2025-09-15T07:56:29.835860Z 0 [Note] InnoDB: Initializing buffer pool, total size = 8M, instances = 1, chunk size = 8M 2025-09-15T07:56:29.836530Z 0 [Note] InnoDB: Completed initialization of buffer pool 2025-09-15T07:56:29.858200Z 0 [Note] InnoDB: Highest supported file format is Barracuda. 2025-09-15T07:56:29.859706Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 235659587 2025-09-15T07:56:29.885430Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 236694974 2025-09-15T07:56:29.886519Z 0 [Note] InnoDB: Database was not shutdown normally! 2025-09-15T07:56:29.886759Z 0 [Note] InnoDB: Starting crash recovery. 2025-09-15T07:56:29.930740Z 0 [Note] InnoDB: Starting an apply batch of log records to the database... InnoDB: Progress in percent: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 2025-09-15T07:56:30.487147Z 0 [Note] InnoDB: Apply batch completed 2025-09-15T07:56:30.492928Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 236694974 2025-09-15T07:56:30.592739Z 0 [Note] InnoDB: Starting an apply batch of log records to the database... InnoDB: Progress in percent: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 2025-09-15T07:56:31.103937Z 0 [Note] InnoDB: Apply batch completed 2025-09-15T07:56:31.312631Z 0 [Note] InnoDB: Removed temporary tablespace data file: &quot;ibtmp1&quot; 2025-09-15T07:56:31.312965Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables 2025-09-15T07:56:31.313350Z 0 [Note] InnoDB: Setting file &#39;.\ibtmp1&#39; size to 12 MB. Physically writing the file full; Please wait ... 2025-09-15T07:56:31.338641Z 0 [Note] InnoDB: File &#39;.\ibtmp1&#39; size is now 12 MB. 2025-09-15T07:56:31.339627Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active. 2025-09-15T07:56:31.339952Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active. 2025-09-15T07:56:31.340353Z 0 [Note] InnoDB: Waiting for purge to start 2025-09-15 15:56:31 0x948 InnoDB: Assertion failure in thread 2376 in file fut0lst.ic line 93 InnoDB: Failing assertion: addr.page == FIL_NULL || addr.boffset &gt;= FIL_PAGE_DATA InnoDB: We intentionally generate a memory trap. InnoDB: Submit a detailed bug report to http://bugs.mysql.com. InnoDB: If you get repeated assertion failures or crashes, even InnoDB: immediately after the mysqld startup, there may be InnoDB: corruption in the InnoDB tablespace. Please refer to InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html InnoDB: about forcing recovery. 07:56:31 UTC - mysqld got exception 0x80000003 ; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware. Attempting to collect some information that could help diagnose the problem. As this is a crash and something is definitely wrong, the information collection process might fail. key_buffer_size=8388608 read_buffer_size=65536 max_used_connections=0 max_threads=151 thread_count=0 connection_count=0 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 58352 K bytes of memory Hope that&#39;s ok; if not, decrease some variables in the equation. Thread pointer: 0x1a9fc88f6f0 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... 2025-09-15T07:56:31.391164Z 0 [Note] InnoDB: 5.7.29 started; log sequence number 236694974 2025-09-15T07:56:31.391917Z 0 [Note] InnoDB: Loading buffer pool(s) from D:\work\w\sql\mysql\mysql-5.7.29.0\exe\data\Data\ib_buffer_pool 2025-09-15T07:56:31.391988Z 0 [Note] Plugin &#39;FEDERATED&#39; is disabled. 2025-09-15T07:56:31.401557Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them. 2025-09-15T07:56:31.401962Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory. 2025-09-15T07:56:31.402887Z 0 [Warning] CA certificate ca.pem is self signed. 2025-09-15T07:56:31.403175Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory. 2025-09-15T07:56:31.403618Z 0 [Note] Server hostname (bind-address): &#39;*&#39;; port: 3306 2025-09-15T07:56:31.403978Z 0 [Note] IPv6 is available. 2025-09-15T07:56:31.404161Z 0 [Note] - &#39;::&#39; resolves to &#39;::&#39;; 2025-09-15T07:56:31.404393Z 0 [Note] Server socket created on IP: &#39;::&#39;. 2025-09-15T07:56:31.404942Z 0 [Note] InnoDB: Buffer pool(s) load completed at 250915 15:56:31 2025-09-15T07:56:31.421205Z 0 [Note] Failed to start slave threads for channel &#39;&#39; 2025-09-15T07:56:31.427275Z 0 [Note] Event Scheduler: Loaded 0 events 2025-09-15T07:56:31.427607Z 0 [Note] D:\work\w\sql\mysql\mysql-5.7.29.0\exe\MySQL Server 5.7\bin\mysqld.exe: ready for connections. Version: &#39;5.7.29-log&#39; socket: &#39;&#39; port: 3306 MySQL Community Server (GPL) 7ff7bf8beeb2 mysqld.exe!my_errno() 7ffc8fbaec9d MSVCR120.dll!raise() 7ffc8fbb4874 MSVCR120.dll!abort() 7ff7bf9da744 mysqld.exe!?reserve@?$vector@EV?$allocator@E@std@@@std@@QEAAX_K@Z() 7ff7bf98298c mysqld.exe!?reserve@?$vector@EV?$allocator@E@std@@@std@@QEAAX_K@Z() 7ff7bf981be4 mysqld.exe!?reserve@?$vector@EV?$allocator@E@std@@@std@@QEAAX_K@Z() 7ff7bf98119c mysqld.exe!?reserve@?$vector@EV?$allocator@E@std@@@std@@QEAAX_K@Z() 7ff7bf980ae2 mysqld.exe!?reserve@?$vector@EV?$allocator@E@std@@@std@@QEAAX_K@Z() 7ff7bf91dd6e mysqld.exe!?reserve@?$vector@EV?$allocator@E@std@@@std@@QEAAX_K@Z() 7ff7bf921f8c mysqld.exe!?reserve@?$vector@EV?$allocator@E@std@@@std@@QEAAX_K@Z() 7ffca5217034 KERNEL32.DLL!BaseThreadInitThunk() 7ffca62bcec1 ntdll.dll!RtlUserThreadStart() Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (0): Connection ID (thread ID): 0 Status: NOT_KILLED The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains information that should help you find out what is causing the crash.
09-16
2025-10-28T19:45:58.820318+08:00 0 [Note] - &#39;::&#39; resolves to &#39;::&#39;; 2025-10-28T19:45:58.821280+08:00 0 [Note] Server socket created on IP: &#39;::&#39;. 2025-10-28T19:45:58.846650+08:00 0 [Note] InnoDB: Buffer pool(s) load completed at 251028 19:45:58 2025-10-28T19:45:58.911119+08:00 0 [Note] Event Scheduler: Loaded 0 events 2025-10-28T19:45:58.912084+08:00 0 [Note] D:\newmysql\mysql-5.7.12-winx64\bin\mysqld: ready for connections. Version: &#39;5.7.12-log&#39; socket: &#39;&#39; port: 3306 MySQL Community Server (GPL) 2025-10-28T20:39:45.659482+08:00 15 [ERROR] InnoDB: Operating system error number 32 in a file operation. 2025-10-28T20:39:45.660451+08:00 15 [ERROR] InnoDB: The error means that another program is using InnoDB&#39;s files. This might be a backup or antivirus software or another instance of MySQL. Please close it to get rid of this error. 2025-10-28 20:39:55 0x740c InnoDB: Assertion failure in thread 29708 in file handler0alter.cc line 7404 InnoDB: Failing assertion: error == DB_SUCCESS InnoDB: We intentionally generate a memory trap. InnoDB: Submit a detailed bug report to http://bugs.mysql.com. InnoDB: If you get repeated assertion failures or crashes, even InnoDB: immediately after the mysqld startup, there may be InnoDB: corruption in the InnoDB tablespace. Please refer to InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html InnoDB: about forcing recovery. 2025-10-28T20:39:55.663376+08:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 9553ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.) 12:39:55 UTC - mysqld got exception 0x80000003 ; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware. Attempting to collect some information that could help diagnose the problem. As this is a crash and something is definitely wrong, the information collection process might fail. key_buffer_size=536870912 read_buffer_size=131072 max_used_connections=51 max_threads=600 thread_count=50 connection_count=50 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 761977 K bytes of memory Hope that&#39;s ok; if not, decrease some variables in the equation. Thread pointer: 0x26ebec94ce0 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... 7ff754c49812 mysqld.exe!my_sigabrt_handler()[my_thr_init.c:449] 7ff754fee349 mysqld.exe!raise()[winsig.c:587] 7ff754fed240 mysqld.exe!abort()[abort.c:82] 7ff754d49b08 mysqld.exe!ut_dbg_assertion_failed()[ut0dbg.cc:67] 7ff754e2f72f mysqld.exe!ha_innobase::commit_inplace_alter_table()[handler0alter.cc:8275] 7ff7545c1443 mysqld.exe!mysql_inplace_alter_table()[sql_table.cc:7449] 7ff7545bf17a mysqld.exe!mysql_alter_table()[sql_table.cc:9538] 7ff7546e565e mysqld.exe!Sql_cmd_alter_table::execute()[sql_alter.cc:316] 7ff754546aa5 mysqld.exe!mysql_execute_command()[sql_parse.cc:3521] 7ff75454938a mysqld.exe!mysql_parse()[sql_parse.cc:5525] 7ff75454239d mysqld.exe!dispatch_command()[sql_parse.cc:1432] 7ff7545433aa mysqld.exe!do_command()[sql_parse.cc:999] 7ff7545081e4 mysqld.exe!handle_connection()[connection_handler_per_thread.cc:301] 7ff754f2cd92 mysqld.exe!pfs_spawn_thread()[pfs.cc:2191] 7ff754c4967b mysqld.exe!win_thread_start()[my_thread.c:38] 7ff754feddbf mysqld.exe!_callthreadstartex()[threadex.c:376] 7ff754fee00a mysqld.exe!_threadstartex()[threadex.c:354] 7ffaba1f84d4 KERNEL32.DLL!BaseThreadInitThunk() 7ffabc6ee871 ntdll.dll!RtlUserThreadStart() Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (26ebece8580): ALTER TABLE formmain_0495 DROP COLUMN field0028 Connection ID (thread ID): 15 Status: NOT_KILLED The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains information that should help you find out what is causing the crash. 2025-10-28T20:43:23.759825+08:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2025-10-28T20:43:23.759825+08:00 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path. 2025-10-28T20:43:23.760771+08:00 0 [Note] D:\newmysql\mysql-5.7.12-winx64\bin\mysqld (mysqld 5.7.12-log) starting as process 39684 ... 2025-10-28T20:43:23.818393+08:00 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2025-10-28T20:43:23.819370+08:00 0 [Note] InnoDB: Uses event mutexes 2025-10-28T20:43:23.819370+08:00 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier 2025-10-28T20:43:23.820343+08:00 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 2025-10-28T20:43:23.821322+08:00 0 [Note] InnoDB: Number of pools: 1 2025-10-28T20:43:23.822294+08:00 0 [Note] InnoDB: Not using CPU crc32 instructions 2025-10-28T20:43:23.866243+08:00 0 [Note] InnoDB: Initializing buffer pool, total size = 8G, instances = 8, chunk size = 128M 2025-10-28T20:43:24.265683+08:00 0 [Note] InnoDB: Completed initialization of buffer pool 2025-10-28T20:43:24.414092+08:00 0 [Note] InnoDB: Highest supported file format is Barracuda. 2025-10-28T20:43:24.508818+08:00 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 933908534 2025-10-28T20:43:24.633818+08:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 933994745 2025-10-28T20:43:24.639683+08:00 0 [Note] InnoDB: Ignoring data file &#39;.\oa\formmain_0495.ibd&#39; with space ID 1585. Another data file called .\oa\#sql-ib1600-4242521553.ibd exists with the same space ID. 2025-10-28T20:43:24.641629+08:00 0 [Note] InnoDB: Ignoring data file &#39;.\oa\formmain_0495.ibd&#39; with space ID 1583. Another data file called .\oa\#sql-ib1602-4242521554.ibd exists with the same space ID. 2025-10-28T20:43:24.643587+08:00 0 [Note] InnoDB: Ignoring data file &#39;.\oa\formmain_0495.ibd&#39; with space ID 1585. Another data file called .\oa\#sql-ib1600-4242521553.ibd exists with the same space ID. 2025-10-28T20:43:24.647490+08:00 0 [Note] InnoDB: Ignoring data file &#39;.\oa\formmain_0495.ibd&#39; with space ID 1583. Another data file called .\oa\#sql-ib1602-4242521554.ibd exists with the same space ID. 2025-10-28T20:43:24.661159+08:00 0 [Note] InnoDB: Database was not shutdown normally! 2025-10-28T20:43:24.661159+08:00 0 [Note] InnoDB: Starting crash recovery. 2025-10-28T20:43:24.844755+08:00 0 [Note] InnoDB: 1 transaction(s) which must be rolled back or cleaned up in total 47 row operations to undo 2025-10-28T20:43:24.845734+08:00 0 [Note] InnoDB: Trx id counter is 14848 2025-10-28T20:43:24.859405+08:00 0 [Note] InnoDB: Starting an apply batch of log records to the database... InnoDB: Progress in percent: 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 2025-10-28T20:43:25.704135+08:00 0 [Note] InnoDB: Apply batch completed 2025-10-28T20:43:32.680689+08:00 0 [Note] InnoDB: Starting in background the rollback of uncommitted transactions 2025-10-28T20:43:32.681665+08:00 0 [Note] InnoDB: Removed temporary tablespace data file: &quot;ibtmp1&quot; 2025-10-28T20:43:32.681665+08:00 0 [Note] InnoDB: Rolling back trx with id 14454, 47 rows to undo 2025-10-28T20:43:32.682647+08:00 0 [Note] InnoDB: Creating shared tablespace for temporary tables 2025-10-28T20:43:32.684595+08:00 0 [Note] InnoDB: Setting file &#39;.\ibtmp1&#39; size to 12 MB. Physically writing the file full; Please wait ... 2025-10-28T20:43:32.695334+08:00 0 [Note] InnoDB: Rollback of trx with id 14454 completed 2025-10-28T20:43:32.696312+08:00 0 [Note] InnoDB: Rollback of non-prepared transactions completed 2025-10-28T20:43:32.732452+08:00 0 [Note] InnoDB: File &#39;.\ibtmp1&#39; size is now 12 MB. 2025-10-28T20:43:32.757857+08:00 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active. 2025-10-28T20:43:32.758821+08:00 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active. 2025-10-28T20:43:32.760764+08:00 0 [Note] InnoDB: Waiting for purge to start 2025-10-28T20:43:32.812522+08:00 0 [Note] InnoDB: 5.7.12 started; log sequence number 933994745 2025-10-28T20:43:32.812522+08:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 8438ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.) 2025-10-28T20:43:32.813529+08:00 0 [Note] Plugin &#39;FEDERATED&#39; is disabled. 2025-10-28T20:43:32.813529+08:00 0 [Note] InnoDB: Loading buffer pool(s) from D:\newmysql\mysql-5.7.12-winx64\data\ib_buffer_pool 2025-10-28T20:43:32.830109+08:00 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key 2025-10-28T20:43:32.832067+08:00 0 [Note] Server hostname (bind-address): &#39;*&#39;; port: 3306 2025-10-28T20:43:32.834022+08:00 0 [Note] IPv6 is available. 2025-10-28T20:43:32.834022+08:00 0 [Note] - &#39;::&#39; resolves to &#39;::&#39;; 2025-10-28T20:43:32.835011+08:00 0 [Note] Server socket created on IP: &#39;::&#39;. 2025-10-28T20:43:32.854535+08:00 0 [Note] InnoDB: Buffer pool(s) load completed at 251028 20:43:32 2025-10-28T20:43:32.904319+08:00 0 [Note] Event Scheduler: Loaded 0 events 2025-10-28T20:43:32.905296+08:00 0 [Note] D:\newmysql\mysql-5.7.12-winx64\bin\mysqld: ready for connections. Version: &#39;5.7.12-log&#39; socket: &#39;&#39; port: 3306 MySQL Community Server (GPL) 数据库异常崩溃,这个怎么解决
最新发布
10-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值